I have an input file of LRECL=80.
My requirement is as below:
IF (1,4,CH,EQ,C'AAAA')
THEN - CHECK FOR IMMEDIATE NEXT RECORD IF IT'S (1,4,CH,EQ,C'BBBB'). Then, write those two records to output file.
there are chances in the input file that, the immediate next records first 4 bytes have characters other than 'BBBB' in which case we dont want to write to output file.
I tried the above code, and it wrked fine. Awesome.
But at the same time when I give the input through a file, then the output file comes empty. Why is it doing so... May be i am missing something out of my ignorance.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Aslam,
When you give it a dataset, is the dataset fixed-length or variable-length records? If variable, (in the RECFM) then you'd need to adjust for the RDW by adding four bytes to all the start positions.
If BBBB represents the lowest logical key possibe after the AAAA key, then you should be OK with the above code.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
Again then, what is the RECFM of your input dataset?
If it contains the same data, and you have the same sort cards, then, assuming you are not getting NOT CATLG's messages for the output, the RECFM must not include F. If it does, then you don't have the same data or you don't have the same sort cards. Or magic has happened. Magic isn't real. Check your input RECFM, contents of dataset and sort cards.
If still mystificed, post the lot, in the Code tags.