Write Reports in cobol.



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Write Reports in cobol.

Postby karthikbuchi » Mon Sep 08, 2014 11:16 am

Hi,

My requirement is as follows.
I have to write 2 headers in the report using cobol. My requirement is as follows.
Read one item from input file and write header in the first page.
-------------------------Header1-------------------------------
Compare that item with 10 other input files and write those records in the report.
But after going to second page the header gets changed to header2.
How do I implement this?.

Report Layout:

-------------------------Header1------------------------------- (page1)
Write compared records....
...
...
...
When you reach page 2 change the header
-------------------------Header2------------------------------- (page2 till you complete writing all records)

This has to repeated for all the items.
karthikbuchi
 
Posts: 6
Joined: Mon Sep 08, 2014 10:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: Write Reports in cobol.

Postby BillyBoyo » Mon Sep 08, 2014 11:43 am

Make a nuce name for a newly-defined field for the page header. After opeing the files, MOVE Header1 to it. After printing it, MOVE Header2 to it.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Write Reports in cobol.

Postby karthikbuchi » Mon Sep 08, 2014 11:55 am

But the headers wont get printed automatically after a new page. What can I do to print the header whenever i reach a new page?. (IS there any way apart from incrementing lines after writing 1 record)
karthikbuchi
 
Posts: 6
Joined: Mon Sep 08, 2014 10:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: Write Reports in cobol.

Postby BillyBoyo » Mon Sep 08, 2014 12:31 pm

Consult the manual for LINAGE, WRITE and EOP/END-OF-PAGE. However, I've never tried it that way.

Have a paragraph/SECTION to WRITE the the detail-line. Increment the line-count. Test against the page-size. Write the headers if needed. Write the detail line. Use a data-name to indicate how many "advancing" lines there are to be for a WRITE.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Write Reports in cobol.

Postby karthikbuchi » Tue Sep 09, 2014 4:08 pm

Hi when is use CBL ARITH(EXTEND) in my pgm.
While I compile that pgm, I am getting an error like
' CBL ' SHOULD NOT BEGIN A-MARGIN
INVALID WORD CBL . SKIPPING TO NEXT RECOGNIZABLE WORD.
What might be the problem?
karthikbuchi
 
Posts: 6
Joined: Mon Sep 08, 2014 10:16 am
Has thanked: 0 time
Been thanked: 0 time

Re: Write Reports in cobol.

Postby NicC » Tue Sep 09, 2014 10:03 pm

The problem is that you have tagged something completely different onto a topic of a different subject. And you have not looked up the manual as to how to code that. (Look in the programming guide)
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post