IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

cobol code to write header for report program


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
raki_new

New User


Joined: 10 Feb 2009
Posts: 26
Location: chennai

PostPosted: Tue Feb 10, 2009 10:23 pm
Reply with quote

hi all,

i have a PS file which has records with indicators 'A ' & 'AB'. i need to write 2 seperate headers for these 2 sets of records in the report. the thing is that the file has first all 'A ' records and then followed by all 'AB' records. so first we have to write a header for 'A ' records and the when it encounters a 'AB' record, it must write another header and then continue with the report. how to do this funtionality. kindly help me.

example of the input file:

Code:
001A 1111111111111111111111
002A 1111111111111111111111
003A 1111111111111111111111
004A 1111111111111111111111
005A 1111111111111111111111
001AB1111111111111111111111
002AB1111111111111111111111
003AB1111111111111111111111
004AB1111111111111111111111
005AB1111111111111111111111


thanks,
Raki
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Wed Feb 11, 2009 2:51 am
Reply with quote

Hello,

In working-storage define a "hold" indicator.

In the procedure code, read a record and if the input indicator is not = the hold indicator write the header and move the input indicator to the hold indicator. Write the report. Continue until end of file.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top