You can have DFSORT process VSAM records as fixed-length (F) or
variable-length (V). When you use VSAM input, DFSORT selects fixed-length
processing if you specify RECORD TYPE=F or variable-length processing
if you specify RECORD TYPE=V. If you do not specify RECORD TYPE=x,
DFSORT selects the record type to use according to the "rules" described
in the discussion of the TYPE operand in RECORD control statement. The
record type selected affects how the records are treated, and how
control statement positions should be specified, as follows:
Variable-length processing: An RRDS, KSDS,
ESDS or VRRDS can always be processed as variable-length. For VSAM
input, DFSORT reads each record and prepends a record descriptor word
(RDW) to it. For VSAM output, DFSORT removes the RDW before writing
each record. Since DFSORT uses an RDW in positions 1-4 to process
variable-length records, the data starts in position 5. Control statement
positions should be specified accordingly.
Fixed-length processing: An RRDS can always
be processed as fixed-length. A KSDS, ESDS or VRRDS used for input
should only be processed as fixed-length if all of its records have
a length equal to the maximum record size defined for the cluster.
Otherwise, input records which are shorter than the maximum record
size are padded with bytes that may or may not be zeros (that is,
"garbage" bytes). DFSORT does not use an RDW to process fixed-length
records, so the data starts in position 1. Control statement positions
should be specified accordingly.
If a data set is password protected, passwords can be entered
at the console or (with some restrictions) through routines at user
exits E18, E38, and E39.
Note: Passwords cannot be handled
in this way for OUTFIL data sets.
If VSAMIO and RESET are in effect, a data set defined with REUSE
can be used for both input and output for a sort; that is, the data
set can be sorted in-place.
A data set used for input or output must have been previously
defined.
If VSAMEMT is in effect, an empty input data set is processed
as having zero records.
VSAM data sets must not be concatenated (system restriction).
VSAM and non-VSAM input data sets must not be specified together
for a sort, merge or copy application.
If output is a VSAM key-sequenced data set (KSDS), the key must
be the first control field (or the key fields must be in the same
order as the first control field). VSAM does not allow you to store
records with duplicate primary keys.
Any VSAM exit function available for input data sets can be used
except EODAD. See the description of E18 use with VSAM in Using your own user exit routines.
You must build the VSAM exit list with the VSAM EXLST macro instruction
giving the addresses of your routines that handle VSAM exit functions.
When processing variable-length records with VSAM input and non-VSAM
output, the output LRECL must be at least 4 bytes greater than the
maximum record size defined for the cluster. Non-VSAM variable-length
records have a record descriptor word (RDW) field 4 bytes long at
the beginning of each record, but VSAM records do not. The record
size defined for the VSAM cluster is therefore 4 bytes less than the
non-VSAM LRECL.
An output data set defined without REUSE is processed as MOD.
If RESET is in effect, an output data set defined with REUSE is
processed as NEW. If NORESET is in effect, an output data set defined
with REUSE is processed as MOD.
DFSORT cannot access VSAM data sets in RLS mode, that is, RLS=CR
and RLS=NRI are not supported for VSAM input and output data sets.