As 1 block contains 4 records (10,20,30 & 40) and the requirement is to look for the string 'OK' in record 20 and if it is satisfied and get the corresponding 10,20,30 & 40 records
For the above example, output file will be -
10 xxxxxxx
20 yyyOK
30 zzzzzzzz
40 aaaaaaa
Is it possible to do this thru DFSORT/ICETOOL?
Record length of the file - 80, position of the string - 4.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
maradha,
To clarify further, do you want to look for 'OK' anywhere in the 20 record, or in specific positions in the 20 record. If in specific positions, what positions are they?
Also, you only show one block of records with OK - can there be more than one block with OK and if so, do you want all of them in the output?
Record type (like 10,20,30,40) is in the first 2 bytes always. String 'OK' is present in the position 6 in record type 20 and it is fixed.
I have just provided the example and there can be many occurences of 'OK' in the record type 20 and whenever it satisfies the condition, we need to extract the complete block (10, 20,30,40) and input file will always have the records in the sequence 10 - 20-30-40 - 10-20-30-40.