DFSORT ProcessingDFSORT Introduction DFSORT DD statements and parameters
There are actually below two types of DFSORT processing.
- Sorting or Copying
- Merging s
Lets discuss each one individually in detail.
1. Sorting or copy:
The below diagram shows the detail process of DFSORT when using it for sorting or copying.
The below diagram shows the detail process of DFSORT when using it for merging
The below information is the detail steps about the above two types of processes.
- As a first step DFSORT verifies SORTIN data set provided for SORT and COPY jobs. Similarly SORTINnn data sets for MERGE jobs. If SORTIN data exists, DFSORT reads the input records and processes it based on conditions.
If no SORTIN data set is present for a SORT or COPY , the records needs to be supplied by cobol user exit( E15 for sorting or copying and E32 for Merging).
- If input records for SORT or COPY are read from a SORTIN data set, DFSORT starts processing specified with the SKIPREC option.
DFSORT logically deletes records until the SKIPREC count is satisfied.
- If the input records for a SORT or COPY are read from a SORTIN data set, DFSORT checks for specified E15 user exit. If so, DFSORT transfers control to the user exit routine.
- DFSORT starts processing on an INCLUDE or OMIT statement specified.
- For SORT or COPY, DFSORT performs processing with the STOPAFT option specified.
- DFSORT performs processing in an INREC statement specified.
- DFSORT performs processing in the SORT, MERGE, or OPTION COPY statement specified.
- For SORT, all input records are processed by default before any output record is processed.
- For COPY or MERGE, an output record is processed after an input record is processed.
- For SORT or MERGE, if a SUM statement is present, it will be processed during the SORT or MERGE.
- DFSORT performs processing in an OUTREC statement specified.
- If an E35 user exit is present, DFSORT transfers control to user exit routine after all statement processing (except OUTFIL) is completed.
- DFSORT writes records to the SORTOUT data set at the end, if present.
- DFSORT performs processing in one or more OUTFIL statements specified, if present.
- DFSORT performs processing with the STARTREC, SAMPLE, and ENDREC options specified.
- DFSORT performs processing with the INCLUDE, OMIT, or SAVE option specified.
- DFSORT performs processing with the ACCEPT option specified. Record processing ends when ACCEPT limit is reached.
- Data records are parsed, edited, reformatted, converted and repeated according to the options specified by using the PARSE, OUTREC, OVERLAY, FINDREP, IFTHEN, FTOV, VTOF (or CONVERT), VLFILL, VLTRIM, VLTRAIL and REPEAT options specified.
- Data records are Reformatted and report records are generated for the OUTFIL data sets by using
- The LINES, HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS, NODETAIL, BLKCCH1, BLKCCH2, BLKCCT1 and REMOVECC options specified.
- Records are distributed among the OUTFIL data sets as evenly as possible by using SPLIT, SPLITBY, or SPLIT1R processing.
- DFSORT writes OUTFIL records to the appropriate OUTFIL data sets.
DFSORT Introduction DFSORT DD statements and parameters