My input file has record types from 1A to 9A(in column postion of 60). My requirement is if the 1A(2bytes) record type is found with 722(in column postion 70), then i have to copy/select this set of records from 1A to 9A to output file.
If this condition of 1A with 722 in columns of 60,70 are not met, then i have to skip the set of 1A-9A records until next matching is found.
Once found again i have to copy/select the set of matched records.
Record Length - 293, Fixed
If you share idea it would be appreciated !!
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
INREC IFTHEN=(WHEN=GROUP with BEGIN for 1A and END for 9A, PUSH the value you want to test after the end of the record (PUSH=(294:70,3) the use OUTFIL INCLUDED= with BUILD to return the records to their normal size.
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
I was thinking you'd come up with a pretty good solution. Then I saw your last line, so you did some good, but not complete, researching :-)
The ID= is the sequential number allocated to all the groups, ID=1 is a one-digit field for this sequence. You only have one group, so one digit is fine. If you had five groups, all the records in the first group would get an one-byte field of value "1", all the second "2", then "3" through to five for the three remaining groups.
With a small number of values defining the group, the AND on the BEGIN is a good idea.
Code:
OUTFIL INCLUDE=(294,1,CH,NE,C' '),BUILD=(1,293)
This is a bit tortuous to read. You could instead OMIT= records whose value is blank or INCLUDE= those with C'1' (now that you know what the ID does).