The tricky words in DFSORT are OUTFIL, OUTREC, INREC and INCLUDE. About these asked in many interviews. This post tells you how to use these correctly. Read my first-post tips ( installment #1), before you go into details.
The rules to understand
DFSORT processes the OUTFIL statements after the INREC and OUTREC statements. Therefore, OUTFIL must refer to the reformatted records produced by OUTREC if specified, or to the reformatted records produced by INREC if it is specified without OUTREC. You will learn about OUTFIL statements in Creating Multiple Output Data Sets and Reports.
Example to understand clearly.
Explained how to use – INCLUDE, INREC, SORT, OUTREC, OUTFIL.
How to differentiate
- The INCLUDE and INREC statements refer to fields as they appear in the input records.
- The SORT and OUTREC statements refer to fields as they appear in the reformatted INREC records.
- The OUTFIL statements refer to fields as they appear in the reformatted OUTREC records.