Operand descriptions
The operands described in this section can be specified in any order.
- FROM(indd)
- See the discussion of this operand on the COPY statement in COPY operator.
- TO(outdd)
- Specifies the ddname of the output data set to which DFSORT
will write the records it selects for the operation (that is, the
records that are kept or not removed according to the specified criteria).
An outdd DD statement must be present and must define an output data set that conforms to the rules for DFSORT's SORTOUT data set.
TO and DISCARD can both be specified. If DISCARD is not specified, TO must be specified. If TO is not specified, DISCARD must be specified.
The ddname specified in the TO operand must not be the same as the ddname specified in the FROM or DISCARD operand.
Refer to JCL restrictions for more information.
- DISCARD(savedd)
- Specifies the ddname of the output data set to which DFSORT
will write the records it does not select for the operation.
A savedd DD statement must be present and must define an output data set that conforms to the rules for DFSORT's OUTFIL data set.
TO and DISCARD can both be specified. If DISCARD is not specified, TO must be specified. If TO is not specified, DISCARD must be specified.
The ddname specified in the DISCARD operand must not be the same as the ddname specified in the FROM or TO operand.
Refer to JCL restrictions for more information.
- KEEP
- Specifies that the records that meet the criteria are to be kept.
- REMOVE
- Specifies that the records that meet the criteria are to be removed.
- INPUT
- Specifies that the criteria are to be applied using the first
n input records, relative input record numbers, and the last n input
records. Use INPUT if you want to apply the criteria directly to
the records from the indd data set.
The criteria will be applied to keep or remove records before they are reformatted by INREC, sorted by SORT and summed by SUM. The kept records will subsequently be reformatted, sorted and summed. OUTFIL will be applied to the resulting records.
As an example, if the input data set contains these records:
and the following SUBSET operator and DFSORT control statements were specified:AAAA R01 AAAA R02 BBBB R03 CCCC R04 CCCC R05 CCCC R06 DDDD R07 DDDD R08 EEEE R09 EEEE R10 EEEE R11
... //TOOLIN DD * SUBSET FROM(IN) TO(OUT) KEEP INPUT RRN(3,10) USING(CTL1) //CTL1CNTL DD * SORT FIELDS=(1,5,CH,D) SUM FIELDS=NONE /*
First, input records 3-10 would be kept, so the intermediate result would be:BBBB R03 CCCC R04 CCCC R05 CCCC R06 DDDD R07 DDDD R08 EEEE R09 EEEE R10
Then the SORT statement would be applied, so the intermediate result would be:EEEE R09 EEEE R10 DDDD R07 DDDD R08 CCCC R04 CCCC R05 CCCC R06 BBBB R03
Finally, the SUM statement would be applied, so the final output in the OUT data set would be:EEEE R09 DDDD R07 CCCC R04 BBBB R03
- OUTPUT
- Specifies that the criteria are to be applied using the first
n output records, relative output record numbers, and the last n output
records. Use OUTPUT if you want to apply the criteria to the indd
records after they are processed by INREC, SORT and SUM as specified.
The criteria will be applied to keep or remove records after they are reformatted by INREC, sorted by SORT and summed by SUM. OUTFIL will be applied to the resulting records.
As an example, if the input data set contains these records:
and the following SUBSET operator and DFSORT control statements were specified:AAAA R01 AAAA R02 BBBB R03 CCCC R04 CCCC R05 CCCC R06 DDDD R07 DDDD R08 EEEE R09 EEEE R10 EEEE R11
... //TOOLIN DD * SUBSET FROM(IN) TO(OUT) KEEP OUTPUT RRN(2,3) USING(CTL1) //CTL1CNTL DD * SORT FIELDS=(1,5,CH,D) SUM FIELDS=NONE /*
First, the SORT statement would be applied, so the intermediate result would be:EEEE R09 EEEE R10 EEEE R11 DDDD R07 DDDD R08 CCCC R04 CCCC R05 CCCC R06 BBBB R03 AAAA R01 AAAA R02
Then the SUM statement would be applied, so the intermediate result would be:EEEE R09 DDDD R07 CCCC R04 BBBB R03 AAAA R01
Finally, output records 2-3 would be kept, so the final output in the OUT data set would be:DDDD R07 CCCC R04
- HEADER or FIRST
- Specifies one header record (the first record) is to be kept
or removed.
HEADER and FIRST are equivalent to HEADER(1) and FIRST(1).
- HEADER(u) or FIRST(u)
- Specifies u header records (the first u records) are to be kept
or removed. For example, HEADER(3) or FIRST(3) keeps or removes
the first three records.
u must be specified as n or +n where n can be 1 to 999999999999999.
- TRAILER or LAST
- Specifies one trailer record (the last record) is to be kept
or removed.
TRAILER and LAST are equivalent to TRAILER(1) and LAST(1).
- TRAILER(v) or LAST(v)
- Specifies v trailer records (the last v records) are to be kept
or removed. For example, TRAILER(4) or LAST(4) keeps or removes the
last 4 records.
v must be specified as n or +n where n can be 1 to 999999999999999.
- RRN(q)
- Specifies relative record number q is to be kept or removed.
For example, RRN(8) keeps or removes the eighth record.
q must be specified as n or +n where n can be 1 to 999999999999999.
- RRN(q,r) or RRN(r,q)
- Specifies relative record numbers q through r are to be kept
or removed. q can be less than, equal to, or greater than r. For example,
RRN(5,10) and RRN(10,5) both keep or remove the fifth through tenth
records.
q and r must be specified as n or +n where n can be 1 to 99999999999999.
- RRN(q,*)
- Specifies relative record numbers q through the last record
are to be kept or removed. For example, RRN(7,*) keeps or removes
the seventh through last records.
q must be specified as n or +n where n can be 1 to 99999999999999.
Note: RRN(*,q) is not valid - USING(xxxx)
- Specifies the first 4 characters of the ddname for the control
statement data set to be used by DFSORT for this operation. xxxx must
be four characters that are valid in a ddname of the form xxxxCNTL.
xxxx must not be SYSx.
If USING is specified, an xxxxCNTL DD statement must be present. Control statements in xxxxCNTL can be used as described for "SUBSET Operator" on page xxx, and must conform to the rules for DFSORT's SORTCNTL data set.
- VSAMTYPE(x)
- See the discussion of this operand on the COPY statement in COPY operator.