Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

cobol code to write header for report program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: cobol code to write header for report program
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

Site Director


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

PostPosted: Wed Feb 11, 2009 2:51 am    Post subject:
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    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 Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts UNIT=AFF for Easytrieve code gandikk JCL & VSAM 7 Wed Jul 12, 2017 11:42 pm
No new posts XML Parse for COBOL 5.2 Bhanu Praveen COBOL Programming 1 Sat Jul 08, 2017 8:58 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us