If you write your E15 user exit in COBOL, see COBOL user exit routines and COBOL E15 user exit: passing or changing records for sort.
The EXITCK option affects the way DFSORT interprets certain return
codes from user exit E15. To avoid ambiguity, this section assumes
that the IBM default, EXITCK=STRONG, was selected at your site. For
complete information about E15 return codes in various situations
with EXITCK=STRONG and EXITCK=WEAK, see E15/E35 return codes and EXITCK.
DFSORT enters the E15 user exit routine each time a new record
is brought into the input phase. DFSORT continues to enter E15 (even
when there are no input records) until the user exit tells DFSORT,
with a return-code of 8, not to return.
See Figure 1 for logic flow details.
Some uses for the E15 user exit are:
- Adding records to an input data set
- Passing an entire input data set to DFSORT
- Deleting records from an input data set
- Changing records in an input data set.
Note: - If your E15 user exit is processing variable-length records, include
a 4-byte RDW at the beginning of each record you change or insert,
before you pass it back to DFSORT. The format of an RDW is described
in z/OS DFSMS Using Data Sets or System Programming Reference. (Alternatively,
you can pad records to the maximum length and process them as fixed-length.)
- DFSORT uses the specified or defaulted value for L2 in the RECORD
statement to determine the length of the records your E15 user exit
passes back to DFSORT. For fixed-length records, be sure that the
length of each record your E15 user exit changes or inserts corresponds
to the specified or defaulted L2 value. For variable-length records,
be sure that the RDW of each record your E15 user exit changes or
inserts indicates a length that is less than or equal to the specified
or defaulted L2 value. Unwanted truncation or abends may occur if
DFSORT uses the wrong length for the records passed to it by your
E15 user exit.
For details of the L2 value, see RECORD control statement
.
- If you use the E15 user exit to pass all your records to DFSORT,
you can omit the SORTIN DD statement, in which case you must include
a RECORD statement in the program control statements.
- If you invoke DFSORT from an assembler program and pass the address
of your E15 user exit in the parameter list, DFSORT ignores the SORTIN
data set and terminates if you specify E15 in a MODS statement.
- If you omit the SORTIN DD statement, or it is ignored, all input
records are passed to DFSORT through your routine at user exit E15.
The address of each input record in turn is placed in general register
1, and you return to DFSORT with a return code of 12. When DFSORT
returns to the E15 user exit after the last record has been passed,
you return to DFSORT with a return code of 8 in register 15, which
indicates "do not return."
- DFSORT continues to reenter your E15 user exit until a return
code of 8 is received. However, if STOPAFT is in effect, no additional
records are inserted to DFSORT after the STOPAFT count is satisfied (even
if you pass back a return code of 12).
- An RDW must be built for variable-length VSAM records (see z/OS DFSMS Using Data Sets).