Filtering by data set characteristics

After DFSMSdss has tentatively selected data sets by applying INCLUDE and EXCLUDE criteria, you can apply BY criteria to further restrict the data sets finally chosen. You can, for example, use BY to select data sets by creation date, storage class, and a wide variety of other criteria. The BY keyword takes this form:

Read syntax diagramSkip visual syntax diagramBY( ,( schar,op,(,arg)) )
Where
Represents
schar
The selection characteristics:
Keyword
Criteria
ALLOC
Allocation type (cylinder, track, block, absolute track, or movable)
CATLG
Whether the data set is currently cataloged or not (using the standard catalog search order)
CREDT
Creation date (absolute or relative)
DSCHA
Whether the data-set-changed flag is on or off
DSORG
Data set organization (SAM, PAM, PDS, PDSE, BDAM, HFS, EXCP, VSAM or zFS)
EXPDT
Expiration date (absolute or relative). Data sets without expiration dates explicitly assigned to them are considered to have an expiration date of zero. If you wish to exclude these data sets from expiration date processing, you must specifically exclude them in your filtering list, that is, BY EXPDT NE 0000000.
EXTNT
Number of allocated or used extents for the entire data set on all the volumes on which it resides
FSIZE
Number of allocated or used tracks for the entire data set on all the volumes on which it resides (data set size)
MULTI
Whether the data set is singlevolume or multivolume (Single volume data sets that have been allocated but have never been opened and are not cataloged may be selected as multivolume)
REFDT
Last-referenced date (absolute or relative)
DATACLAS
Data class for SMS
MGMTCLAS
Management class for SMS
STORCLAS
Storage class for SMS
op
The operator:
Operator
Meaning
EQ or =
Equal to
LE or <=
Less than or equal to
LT or <
Less than
GT or >
Greater than
GE or >=
Greater than or equal to
NE or ¬=
Not equal to
arg
An argument that qualifies the selection characteristic (schar).
Table 1 summarizes the permissible combinations of schar, op, and arg.
Table 1. BY Keywords
schar op arg Notes
ALLOC EQ NE
CYL (cylinder
allocation) TRK (track
allocation)
BLK (block length
allocation)
ABSTR (absolute track
allocation)
MOV (movable data sets)
If MOV is picked, the data sets to be processed cannot be allocated as any of the following:
  • PSU (physical sequential unmovable)
  • POU (partitioned organization unmovable)
  • DAU (BDAM unmovable)
  • ABSTR (absolute tracks)

COMPRESS command: If MOV is picked, only data sets allocated as POU cannot be compressed.

MULTI EQ
YES (or 1)
NO (or 0)
YES: DFSMSdss processes only multivolume data sets. NO: DFSMSdss processes only singlevolume data sets.

DEFRAG command: If a data set’s volume sequence number is greater than one in the VTOC, DFSMSdss assumes it is multivolume. If this sequence number is 1, DFSMSdss assumes it is a single volume data set.

COMPRESS command: Because DFSMSdss assumes the data set is single volume, you do not need to specify MULTI.

Note: Single volume data sets that have been allocated but have never been opened and are not cataloged may be selected as multivolume.
CATLG EQ
YES (or 1)
NO (or 0)
YES: Only currently cataloged data sets are processed. NO: Only uncataloged data sets are processed.

DUMP command: The CATLG filter is valid only when used with an input volume list (INDD, INDY, LOGINDD, LOGINDY, STORGRP).

COPY command: The CATLG filter is valid only when used with an input volume list (INDD, INDY, LOGINDD, LOGINDY, STORGRP).

RESTORE command: The target data set is tested to determine if it is cataloged or not.

Note:
  1. Data sets cataloged through JCL are not cataloged until the job step ends. Therefore, when you use the (CATLG,EQ,NO) filter, you should also use a CREDT or REFDT filter. The value used in the CREDT or REFDT filter should be for data sets at least two days old: (CREDT,LE,*,-2) or (REFDT,LE,*,-2).
  2. A data set is considered uncataloged if it is not cataloged in the standard order of search or if it is cataloged in an unavailable catalog.
CREDT
EXPDT
REFDT
LT
GT
EQ
NE
GE
LE
[yy]yyddd(,n): 4-digit (or 2-digit) year and 3-digit day, modified by an optional 1-digit to 4-digit positive or negative number of days, n. The year values range from 1900 through 9999. For example, 1998100 (or 98100) is the 100th day of 1998 and 2000001 (or 00001) is the first day of 2000.

*(,n): Current date (run date), modified by an optional 1-digit to 4-digit positive or negative number of days, n. For example, *,-5 is five days before this job is run.

NEVER: Never-expire date (valid only for EXPDT). A never-expire data set has an expiration date in its VTOC entry of 99365, 99366, or 99999.

The preferred form of a date has a 4-digit year (yyyyddd). When you specify a date with a 4-digit year other than a date of all zeros, the smallest valid date before modification is 1900001. When you specify a date with the 2-digit year format (yyddd), a yy of 00 through 49 indicates years 2000 through 2049; a yy of 50 through 99 indicates years 1950 through 1999. You must use the 4-digit year format if you wish to filter on years 1900 through 1949 or on years higher than 2049.

CREDT and EXPDT: For a multivolume data set, the date from its first volume’s VTOC is used for checking.

EXPDT: When you specify a date of 99365 or 1999365, you are specifying the last day of 1999. When you specify EXPDT with NEVER, 99366, 1999366, 99999, 1999999, or 9999999, you ask DFSMSdss to look for all valid forms of never-expire dates (including 99365 in a data set’s VTOC entry). Therefore, BY(EXPDT,EQ,1999365) selects no data sets. DFSMSdss considers the valid forms of never-expire dates as equal to each other and as greater than all other dates. A never-expire date cannot be modified and cannot be specified with the GT operator.

REFDT: For a multivolume data set, the latest date from all its VTOCs is used for checking.

RELEASE and DEFRAG commands: The date in the VTOC of the volume being processed is used for filtering both single- and multivolume data sets.

DSCHA
EQ
NE
YES (or 1)
NO (or 0)
For a multivolume data set, the value used for checking is 1 if any of the indicators from all of its VTOCs is 1. Otherwise, the value is 0.
DSORG
EQ
NE
SAM (all sequential data sets, including compressed and striped), PAM (partitioned data sets, including PDS and PDSE), PDS, PDSE, BDAM (all direct access data sets), VSAM (includes all VSAM data set types), zFS (zFS data sets),EXCP (applies to data sets not allocated as any of the listed organizations and not accessed by using any of the listed access methods) COMPRESS command: Because DFSMSdss assumes data set organization, you do not need to specify it.

The selective characteristic of DSORG can be specified more than once.

DATACLAS
MGMTCLAS
STORCLAS
EQ
NE
An appropriate SMS class name.  
EXTNT
FSIZE
LT
GT
EQ
NE
GE
LE
nnnnnnnn (1-digit to 8-digit decimal number, from 0 to 99999999) nnnnnnnn is the number of used or allocated extents (EXTNT) or used or allocated tracks (FSIZE).

RESTORE command: The data set that was dumped determines the number of used or allocated extents or tracks.

DUMP and COPY commands:

  • For non-VSAM data sets:
    • If ALLDATA or ALLEXCP is specified, FSIZE is equal to the allocated tracks, and EXTNT is equal to the allocated extents.
    • If ALLDATA or ALLEXCP is not specified, FSIZE is equal to the used tracks, and EXTNT is equal to the used extents.
      Note: A specification of FSIZE,EQ,0 can be used to select PDSE data sets that have no members (that is, have no used directory blocks), and a specification of FSIZE,NE,0 can be used to exclude PDSE data sets that have no members.
  • For VSAM data sets, FSIZE is always equal to the allocated tracks, and EXTNT is always equal to the allocated extents.

Logical data set COPY, DUMP, and RESTORE commands:  

  • FSIZE criteria are applied once for the entire data set on all volumes that the data set resides on. For logical processing of HFS files with TYPRUN NORUN, FSIZE equals all of the allocated space. For logical processing of HFS files without TYPRUN NORUN, the used space represents the FSIZE unless ALLDATA was specified.
  • EXTNT criteria are applied to non-VSAM data sets once for the data set on all volumes that the data set resides on.
  • EXTNT criteria are applied to each VSAM data component on all volumes that the VSAM data component resides on. If a VSAM data component is selected by EXTNT filtering, the index component for the cluster is automatically selected.

Physical data set DUMP and RESTORE commands:  

  • FSIZE criteria are applied once for each volume being processed of a non-VSAM or VSAM data set. For HFS data sets, FSIZE equates to the allocated space, not the space actually used.
  • EXTNT criteria are applied once for each volume being processed of a non-VSAM data set or VSAM data component. If a VSAM data component residing on a volume is selected by EXTNT filtering, the index component (if any) residing on the same volume for the cluster is automatically selected.
  • FSIZE and EXTNT can be used to select certain volumes of a multivolume data set without selecting all of the volumes that the data set resides on.

DEFRAG commands:  

  • For VSAM data sets, EXTNT and FSIZE criteria are applied at the VSAM component level for the volume being processed only. EXTNT and FSIZE filtering are performed for both VSAM data and index components; VSAM index components are not automatically selected if the data component for the cluster is selected.
  • For non-VSAM data sets, EXTNT and FSIZE criteria are applied for the volume being processed only. For HFS data sets, FSIZE equates to the allocated space, not the space actually used.
Note:
  1. When multiple arguments are specified for an NE operation, DFSMSdss selects only those data sets not matching any of the arguments.
  2. When multiple arguments are specified for an EQ operation, DFSMSdss selects those data sets matching any of the arguments.
  3. BY criteria do not apply for the CONVERTV or COPYDUMP commands.