| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| intra73 Beginner
 
 
 Joined: 26 Apr 2004
 Posts: 2
 Topics: 2
 Location: San Francisco
 
 | 
			
				|  Posted: Mon Apr 26, 2004 4:25 pm    Post subject: How to code a page break in cobol source code |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		| kolusu Site Admin
 
  
 
 Joined: 26 Nov 2002
 Posts: 12394
 Topics: 75
 Location: San Jose
 
 | 
			
				|  Posted: Mon Apr 26, 2004 4:50 pm    Post subject: |   |  
				| 
 |  
				| 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 |  | 
	
		|  | 
	
		|  | 
	
		|  |