MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to code a page break in cobol source code

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
intra73
Beginner


Joined: 26 Apr 2004
Posts: 2
Topics: 2
Location: San Francisco

PostPosted: Mon Apr 26, 2004 4:25 pm    Post subject: How to code a page break in cobol source code Reply with quote

Can someone help me please - I have a report that is being written in cobol with headings and detail. The client wants a page break when the customer changes.

This file will be emailed to a group and they are requesting that when they print the file it breaks on a new page (per customer) - How do I code a page break in the file.

thanks,
-np
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Mon Apr 26, 2004 4:50 pm    Post subject: Reply with quote

Intra73,

Code a working storage variable to store the customer name. Have a working storage variable to print the header everytime the customer changes. value of '1' is a carriage control which lets you print on a new page


Code:

01 P-RPT-HEADER.
   05  P-H1-CC                 PIC  X(01)  VALUE '1'.       
   05  FILLER                  PIC  X(14)  VALUE           
       '   REPORT ID: '.                                   
   05  P-H1-REPORT-ID          PIC  X(08)  VALUE SPACES.   
   05  FILLER                  PIC  X(34)  VALUE SPACES.   
   05  FILLER                  PIC  X(20)  VALUE           
       'FORECAST 2000 SYSTEM'.                             
   05  FILLER                  PIC  X(41)  VALUE SPACES.   
   05  FILLER                  PIC  X(06)  VALUE 'PAGE: '. 
   05  P-H1-PAGE               PIC  ZZZ,ZZ9 VALUE ZERO.     
   05  FILLER                  PIC  X(02)  VALUE SPACES.   


01  W-CUSTOMER-NAME          PIC X(50) VALUE SPACES.

IF W-CUSTOMER-NAME = INFILE-CUSTOMER-NAME
   WRITE DETAIL LINE OF CUSTOMER
ELSE                           
    WRITE REPORT FROM P-RPT-HEADER             
    MOVE INFILE-CUSTOMER-NAME TO W-CUSTOMER-NAME
    WRITE DETAIL LINE OF CUSTOMER
END-IF                                             



Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group