Author: Bill Woodger
Subject: Reply to: Inserting records based on conditions
Posted: Wed Feb 22, 2017 11:49 pm (GMT 5.5)
JOINKEYS.
Use JNF1CNTL, INREC, WHEN=INIT to assign a sequence number to each (of the two) record.
Use JNF2CNTL, INREC, WHEN=GROUP, RECORDS=10 to assign ID for each group.
The key is the sequence and ID.
SORTED,NOSEQCK
REFORMAT contains all original data for F1 and F2.
In the main task, INREC, WHEN=GROUP, RECORDS=10, append a SEQ.
OUTFIL, IFTHEN=(WHEN=(logical expression to test for one in the SEQ-field appended, BUILD with the slash-operator (/) to output two records (from the F1 and the F2 parts of the REFORMAT record). WHEN=NONE to just BUILD from from the F2 part of the REFORMAT record.
Subject: Reply to: Inserting records based on conditions
Posted: Wed Feb 22, 2017 11:49 pm (GMT 5.5)
JOINKEYS.
Use JNF1CNTL, INREC, WHEN=INIT to assign a sequence number to each (of the two) record.
Use JNF2CNTL, INREC, WHEN=GROUP, RECORDS=10 to assign ID for each group.
The key is the sequence and ID.
SORTED,NOSEQCK
REFORMAT contains all original data for F1 and F2.
In the main task, INREC, WHEN=GROUP, RECORDS=10, append a SEQ.
OUTFIL, IFTHEN=(WHEN=(logical expression to test for one in the SEQ-field appended, BUILD with the slash-operator (/) to output two records (from the F1 and the F2 parts of the REFORMAT record). WHEN=NONE to just BUILD from from the F2 part of the REFORMAT record.