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.
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
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.