My requirement is as below. There are two records shown below starting with Line 1 as rec 1 and next Line 1 as rec 2. Each Line 1 is the beginning of a record. I need to take 3 bytes from the row starting with REPORT (20:3) and merge with DATA rows(only if the fields from 78:20 in the DATA row is having a certain value).
REPORT: XXXXXX-YY CAY M#$
DATA1(120 LENGTH- IDENTIFIER FIELD 78:20 )
DATA2(120 LENGTH- IDENTIFIER FIELD 78:20 )
REPORT: XXXXXX-YY WIX M#$
DATA(120 LENGTH- IDENTIFIER FIELD 78:20 )
OUT Put needs to be
We can do it via a cobol program but would it be feasible via a sort or ice tool ? Please let me know.
Welcome to the forums. Look for 'WHEN=GROUP' examples here. You could OMIT unwanted records and use WHEN=GROUP to identify the 'groups' starting with 'REPORT' and PUSH the 3-byte field across the group. INCLUDE only the 'DATA' records in your OUTFIL and rearrange the fields as needed in your BUILD.
Use Code tags(Code button in the editor) and do a Preview before posting code/data. Good luck!