Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Display total page number in report print-out

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
wicked1925

New User


Joined: 12 Mar 2007
Posts: 15
Location: Philippines

PostPosted: Mon Mar 19, 2007 2:52 pm    Post subject: Display total page number in report print-out
Reply with quote

hi guys...

i'm making a report print-out and i want it to have the page number and total number of page printed on every page pf the report, something like:


page 9 of 99


the page number is quite easy but the total number of pages (bold part) is a total mind bugging one. is there a way or function that can predict the total pages that will be printed in the print lines? btw i'm using cobol 85.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Mar 19, 2007 3:15 pm    Post subject:
Reply with quote

One way would be to count your input and divide by the number of detail lines per page.
Another way would be to write the report to a temp file and while reading it back to print plug the total page count.
Back to top
View user's profile Send private message
wicked1925

New User


Joined: 12 Mar 2007
Posts: 15
Location: Philippines

PostPosted: Mon Mar 19, 2007 3:27 pm    Post subject:
Reply with quote

>>One way would be to count your input and divide by the number of detail lines per page.

can you make a detailed explanation for this? i'm using data inputs from a DB2 table and i want the page number part to be printed on the 50th line in each page.


>>Another way would be to write the report to a temp file and while reading it back to print plug the total page count.

are you pertaining on the JCL part on this one?


thanks for reply...i really appreciated what you have said.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Mar 19, 2007 4:41 pm    Post subject:
Reply with quote

Find out how many rows will be in your report and how many rows will fit on a page and divide one into the other to calculate how many pages will be needed to complete the report.

Why would you think JCL, this is a COBOL forum.
Instead of outputing the report to a printer, output it to a temp dataset. When the report is all finished, you know how many pages it took.
Close the temp file,
open it for input,
open the print file for output, read temp file record,
if this is "the 50th line in each page" move the total page number,
write the temp file input record out to the print file,
repeat until eof on the temp file.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Mar 19, 2007 7:42 pm    Post subject:
Reply with quote

Hello,

As you write the temp file, the program will keep track of how many pages it read. As each page is printed, the page number is printed on the page.

When reading the temp file back in, look for the "PAGE NO nn OF" and place the total page count after the OF.

If you look for the "page line", you won't need to count lines which is more difficult if the report is complex.

Good luck icon_smile.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Binary to display characters Roy Ware SYNCSORT 3 Tue Sep 19, 2017 8:46 pm
No new posts DB2 NULL Values display V S Amarendra Reddy DB2 3 Thu Sep 07, 2017 6:59 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts Profile changed to NUMBER ON STD (fro... Martylin TSO/ISPF 1 Thu Aug 03, 2017 9:14 am
No new posts Display upon console bipinpeter COBOL Programming 1 Thu Jun 22, 2017 12:35 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us