|
You must prepare job control language (JCL)
statements and DFSORT program control statements to invoke DFSORT
processing. JCL statements (see Invoking DFSORT from a program) are
processed by your operating system. They describe your data sets to
the operating system and initiate DFSORT processing. DFSORT program
control statements (see Using DFSORT program control statements) are processed
by the DFSORT program. They describe the functions you want to perform
and invoke the processing you request.
A sort application usually requires intermediate storage as working
space during the program run. This storage can be one of the following:
- Hiperspace, using DFSORT's Hipersorting feature.
- Work data sets—either allocated dynamically by DFSORT's DYNALLOC
facility or specified by the user, using JCL DD statements. If specified
by the user, the intermediate storage devices and the amount of work
space must be indicated. Methods for determining the amount of work
space to allocate are explained in Using work space.
- A combination of Hiperspace and work data sets.
Merge and copy applications do not require intermediate storage.
Figure 1 illustrates the processing
order for record handling, exits, statements, and options. Use this
diagram with the text following it to understand the order DFSORT
uses to run your job.
Figure 1. Record
Processing Order
As shown in Figure 1, DFSORT processing
follows this order: - DFSORT first checks whether you supplied a SORTIN data set for
SORT and COPY jobs or SORTINnn data sets for MERGE jobs. If so, DFSORT
reads the input records from them.
- If no SORTIN data set is present for a SORT or COPY job, you must
use an E15 user exit to insert all the records. (This is also true
if you invoke DFSORT from a program with the address of an E15 user
exit in the parameter list, because SORTIN will be ignored.) DFSORT
can use a COBOL E15 routine if you specified the E15 user exit in
the MODS statement.
- If no SORTINnn data sets are present for a MERGE job, you must
use an E32 user exit to insert all the records.
- If input records for SORT or COPY jobs are read from a SORTIN
data set, DFSORT performs processing specified with the SKIPREC option.
DFSORT deletes records until the SKIPREC count is satisfied. Eliminating
records before a SORT or COPY gives better performance.
- If the input records for a SORT or COPY job are read from a SORTIN
data set, DFSORT checks whether you specified an E15 user exit. If
so, DFSORT transfers control to the user exit routine. You can use
a COBOL E15 routine if the E15 user exit is specified in the MODS
statement. The E15 routine can insert, delete, or reformat records.
- DFSORT performs processing specified on an INCLUDE
or OMIT statement. If you used an E15 user exit routine to reformat
the records, the INCLUDE/OMIT fields you specify must apply to the
current format rather than to the original format. If you use the
INCLUDE or OMIT statements to delete unnecessary records before SORT,
MERGE, or COPY processing, your jobs run more efficiently.
- For SORT or COPY jobs, DFSORT performs processing specified with
the STOPAFT option. Record input stops after the maximum number of
records (n) you specify have been accepted. DFSORT accepts records
for processing if they are:
- Read from SORTIN or inserted by E15
- Not deleted by SKIPREC
- Not deleted by E15
- Not deleted by an INCLUDE or OMIT statement.
- DFSORT performs processing specified in an INREC statement.
Data records are parsed, edited and reformatted according to the options
specified. If you reformatted the records before this step, the INREC
fields you specify must apply to the current format rather than to
the original format.
- DFSORT performs processing specified in the SORT, MERGE, or OPTION
COPY statement.
- For SORT, all input records are processed 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, DFSORT
processes it during the SORT or MERGE processing. DFSORT summarizes
the records and deletes duplicates. If you reformatted the records
before this step, the SORT or MERGE and SUM fields you specify must
apply to the current format rather than to the original format.
- DFSORT performs processing specified in an OUTREC statement.
Data records are parsed, edited and reformatted according to the options
specified. If you reformatted the records before this step, the
OUTREC fields you specify must apply to the current format rather
than to the original format.
- If an E35 user exit is present, DFSORT transfers
control to your user exit routine after all statement processing (except
OUTFIL) is completed. If you reformatted the records, the E35 user
exit receives the records in the current format rather than in the
original format. You can use a COBOL E35 routine if you specify the
E35 user exit in the MODS statement. You can use the E35 exit routine
to add, delete, or reformat records.
If SORTOUT and OUTFIL
data sets are not present, the E35 exit must dispose of all the records
because DFSORT treats these records as deleted. (This is also true
if you do not specify OUTFIL data sets and DFSORT is invoked with
the address of an E35 user exit in the parameter list, because SORTOUT
will be ignored.)
- DFSORT writes your records to the SORTOUT data set, if present.
- DFSORT performs processing specified in one or more OUTFIL statements,
if present:
- DFSORT performs processing specified with the STARTREC, SAMPLE,
and ENDREC options. Record input for the OUTFIL data sets starts with
the record indicated by STARTREC, ends with the record indicated by
ENDREC, and is sampled according to the records indicated by SAMPLE.
- DFSORT performs processing specified with the INCLUDE, OMIT, or
SAVE option. Records are included or omitted from the OUTFIL data
sets according to the criteria specified.
- DFSORT performs processing specified with the ACCEPT
option. Record processing ends when the ACCEPT limit is reached.
- DFSORT performs processing specified with the PARSE,
OUTREC (or BUILD), OVERLAY, FINDREP, IFTHEN,
FTOV, VTOF (or CONVERT), VLFILL, VLTRIM, VLTRAIL and
REPEAT options. Data records are parsed, edited, reformatted, converted
and repeated according to the options specified.
- DFSORT performs processing specified with the LINES,
HEADER1, TRAILER1, HEADER2, TRAILER2, SECTIONS, NODETAIL, BLKCCH1,
BLKCCH2, BLKCCT1 and REMOVECC options. Data records are reformatted
and report records are generated for the OUTFIL data sets.
- DFSORT performs SPLIT, SPLITBY, or SPLIT1R processing.
Records are distributed among the OUTFIL data sets as evenly as possible.
- DFSORT writes your OUTFIL records to the appropriate OUTFIL data
sets.
|