In this topic, we described about the OUTFIL with detailed example.
One or more output datasets and reports can be created from a single pass oversorted, merged, or copied input using OUTFIL control statements.
Different OUTFIL parameters on different OUTFIL statements can be used. The output records created by the processing for the other statements are the input records for OUTFIL processing.
Combining the various DFSORT statements in different ways gives a lot of flexibility. OUTFIL statements can be used with different INCLUDE or OMIT and OUTREC, OVERLAY, or IFTHEN parameters for creating different OUTFIL files.
The following tasks can perform with each OUTFIL statement,
- Repeating records with the REPEAT parameter.
- Creating detailed reports using the BUILD, OUTREC, OVERLAY, IFTHEN, HEADERn, TRAILERn, SECTIONS, LINES, NODETAIL, BLKCCH1, BLKCCH2, BLKCCT1, and REMOVECC parameters.
- Selecting a sequential subset of records with the STARTREC and ENDREC parameters.
- Limit the number of records selected with the ACCEPT parameter.
- Selecting a sample of records with the SAMPLE parameter.
- Selecting "discarded" records with the SAVE parameter which saves any records that are not selected as a result of STARTREC, ENDREC, SAMPLE,INCLUDE, OMIT or ACCEPT parameters.
- Selecting a subset of records with the INCLUDE and OMIT parameters.
- Reformat records with fixed position/length fields or variable position/length fields using the PARSE, BUILD, OUTREC, OVERLAY, or IFTHEN parameters.
- Splitting records between output data sets using the SPLIT, SPLITBY, and SPLIT1R parameters.
- Converting FB records to VB records with the FTOV parameter, or convert VB records to FB records with the VTOF parameter.
- Update count and total values in an existing trailer (last) record with the IFTRAIL parameter.