Page 1 of 1

Write Reports in cobol.

PostPosted: Mon Sep 08, 2014 11:16 am
by karthikbuchi
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.

Re: Write Reports in cobol.

PostPosted: Mon Sep 08, 2014 11:43 am
by BillyBoyo
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.

Re: Write Reports in cobol.

PostPosted: Mon Sep 08, 2014 11:55 am
by karthikbuchi
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)

Re: Write Reports in cobol.

PostPosted: Mon Sep 08, 2014 12:31 pm
by BillyBoyo
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.

Re: Write Reports in cobol.

PostPosted: Tue Sep 09, 2014 4:08 pm
by karthikbuchi
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?

Re: Write Reports in cobol.

PostPosted: Tue Sep 09, 2014 10:03 pm
by NicC
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)