z/OS DFSORT Application Programming Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


SUBSET operator

z/OS DFSORT Application Programming Guide
SC23-6878-00

Read syntax diagramSkip visual syntax diagram
>>-SUBSET--FROM(indd)--+-TO(outdd)------------------+----------->
                       +-DISCARD(savedd)------------+   
                       '-TO(outdd)--DISCARD(savedd)-'   

>--+-KEEP---+--+-INPUT--+--+-----------+--+------------+-------->
   '-REMOVE-'  '-OUTPUT-'  +-HEADER----+  +-TRAILER----+   
                           +-FIRST-----+  +-LAST-------+   
                           +-HEADER(u)-+  +-TRAILER(v)-+   
                           '-FIRST(u)--'  '-LAST(v)----'   

>--+----------+--+-------------+--+-------------+--------------><
   +-RRN(q)---+  '-USING(xxxx)-'  '-VSAMTYPE(x)-'   
   +-RRN(q,r)-+                                     
   +-RRN(r,q)-+                                     
   '-RRN(q,*)-'                                     

Keeps or removes input or output records based on meeting criteria for the first n records, specific relative record numbers, and the last n records. DFSORT writes the records that are kept or not removed to the outdd data set.

DFSORT is called to copy or sort the indd data set, as appropriate. ICETOOL uses its E15 or E35 exit to determine which records to include in the outdd or savedd data set. ICETOOL passes the EQUALS option to DFSORT to ensure that duplicates are kept in their original input order if records are sorted.

If the criteria includes the last n records, ICETOOL may call DFSORT twice. For the first pass, ICETOOL counts the indd records without opening the output data sets. For the second pass, ICETOOL opens the output data sets and does SUBSET processing against the indd data set using the count obtained in the first pass.

DISCARD(savedd) can be used to write the records that are removed or not kept in the savedd data set. DISCARD(savedd) can be used with or without TO(outdd).

If you do not specify a header operand (HEADER, FIRST, HEADER(u), FIRST(u)), a relative record number operand (RRN(q), RRN(q,r), RRN(q,*)), or a trailer operand (TRAILER, LAST, TRAILER(v), LAST(v)), all of the records will be kept or removed. You can specify a header operand, relative record number operands, and a trailer operand in any combination. Records will be kept or removed according to the criteria you specify.

You can only specify one header operand. You can specify from 1 to 300 relative record number operands in any combination. You can only specify one trailer operand.

The DFSORT control statements in xxxxCNTL are used if USING(xxxx) is specified. However, you must observe these rules for control statements in the xxxxCNTL data set:

  • MODS and OUTREC statements should not be present.
  • SKIPREC and STOPAFT operands, and INCLUDE and OMIT statements, should not be present.
  • A SORT statement can be present unless INPUT and DISCARD(savedd) are specified.
  • INREC and SUM statements can be present.
  • If INPUT is specified, the records selected will not be affected by INREC, SORT or SUM. If OUTPUT is specified, the records selected will be affected by INREC, SORT and SUM.
  • Comment statements can be present.
  • If you specify TO(outdd) without DISCARD(savedd), you can further process the outdd records after SUBSET processing using an OUTFIL statement like this:
      OUTFIL FNAMES=outdd,...
    or multiple OUTFIL statements like this:
      OUTFIL FNAMES=outdd,...
      OUTFIL FNAMES=outdd1,...
  • If you specify DISCARD(savedd) without TO(outdd), you can further process the savedd records after SUBSET processing using one (and only one) OUTFIL statement like this:
      OUTFIL FNAMES=savedd,...
  • If you specify TO(outdd) and DISCARD(savedd), you can further process the outdd and savedd records after SUBSET processing using two (and only two) OUTFIL statements like this:
      OUTFIL FNAMES=outdd,...
    or multiple OUTFIL statements like this:
      OUTFIL FNAMES=outdd,...
      OUTFIL FNAMES=savedd,...
    Both statements must be specified in the order shown with at least the FNAMES parameter. For example, to further modify only the DISCARD data set, you could use statements like this:
      OUTFIL FNAMES=OUT
      OUTFIL FNAMES=SAVE,OMIT=(21,3,ZD,GT,+25)
If you specify a SORT statement in xxxxCNTL, the DYNALLOC option is passed to DFSORT to ensure that work space is available for the sort. If your installation defaults for dynamic allocation are inappropriate for a SUBSET operator, you can take one of the following actions:
  1. Override the DYNALLOC option using an OPTION control statement such as:
      OPTION DYNALLOC=(,8)
    in the xxxxCNTL data set.
  2. Use xxxxWKdd DD statements to override the use of dynamic allocation. Refer to SORTWKdd DD statement for details.

Tape work data sets cannot be used with ICETOOL.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014