Generic Data Set Name Selection


On many FDR control statements, a function is available that allows you to select data sets for processing using a generic name, also called a “data set name filter”. The documentation for various FDR statements refer to this section wherever it is supported. Do not assume it works for every statement, check the documentation.

Generic data set name selection allows to you specify a filter that is applied to all data sets selected from system catalogs, VTOCs, backup files, or the Archive Control File. The filter allows you a great deal of flexibility in specifying the names to be selected.

Filter characters

The data set name filter is a string of characters that specify the data sets to be selected. Each character in the filter may represent a single character in the name of the data sets or may represent a variable number of characters. The filter characters may be:

Any alphanumeric character (A-Z or 0-9) or national character ($ # @ in the US) represents itself and must appear in the indicated position in the data set name.

/ (slash) or % (percent) represents ANY single valid alphanumeric or national character.

 (vertical bar) represents any single alphabetic (A-Z) character.

+ (plus) represents any single numeric (0-9) character.

? (question) represents any single national ($ # @ in the US) character.

. (period) is used to separate index levels. For compatibility with earlier releases, if the filter begins with one or more periods, this indicates that many index levels at the beginning of the name are to be skipped over before applying the rest of the filter.

* (asterisk) by itself as an index level indicates that the index level must exist in the selected name, but that it can contain any valid characters and can be any valid length (1 to 8 characters). However, if a single asterisk is combined with other characters in an index level, then it represents a variable length string (zero or more characters) at that point in the index level.

** (double asterisk with no trailing period) represents zero or more characters or index levels. The filter routine tries to apply the remainder of the filter to the data set name beginning with the current character and stepping through the name until it matches or until the end of the name is reached.

**. (double asterisk with a trailing period) also represents zero or more characters or index levels, but the filter routine tries to apply the remainder of the filter to the data set name at the beginning of each index level (if not currently at the beginning of a level, it starts at the next level).

These special cases apply to “**” with periods:

**. at the beginning of the filter represents zero or more whole index levels at the beginning of the name.

.** at the end of the filter represents zero or more whole index levels at the end of the name.

Important

The XDSN= operand of FDREPORT, the implementation is slightly different: “**.” and “.**” represent ONE or more index levels at the beginning or end of the name.

The examples that follow make this clearer, and shows you how flexible filtering is.

The examples below are designed to illustrate the power and flexibility you have in using FDR’s generic data set name selection.

Generic DSN selection example 1

Filter ACCOUNTS.PAY** selects data sets beginning with “ACCOUNTS.PAY” such as:

ACCOUNTS.PAY.OVERDUE 
ACCOUNTS.PAYROLL.CHECKS

Generic DSN selection example 2

Filter USER1.*.CNTL selects any 3-level data set name with “USER1” as the first level and “CNTL” as the third, such as:

USER1.JCL.CNTL 
USER1.TEST.CNTL

Generic DSN selection example 3

Filter USER+.**.*LIST selects any data set whose first index is “USERn” (“n” is numeric) and whose last index level ends in “LIST” (including “LIST” by itself) with any number of index levels between them, such as:

USER1.LIST
USER3.ISPF.OUTLIST
USER9.TEST.PRINT.MYLIST

Generic DSN selection example 4

Filter **TEST** selects any data set with the string “TEST” anywhere in the name, such as:

ABC.TEST.GHI.XYZ 
TEST2.LIST 
REPORT.CURRENT.TESTUSER3.MYTEST

Generic DSN selection example 5

Filter **A**?**B** selects any data set whose name contains an “A”, a national character, and a “B”, in that order, such as:

SYS1.A.X#B 
APPLIC1.A@B.LOAD 
APPLIC2.MASTER.BALANCE$.BOUNCE

Generic DSN selection example 6

Filter PAYROLL.%%||+*.FILE selects any three-level data set whose first index is “PAYROLL”, whose second index consists of any two characters followed by any two alphabetic characters followed by any one numeric character, and up to three more characters, and whose third index is “FILE”, such as:

PAYROLL.DCLX5.FILE 
PAYROLL.A4TV3LM.FILE

Generic DSN selection example 7

Filter PAYROLL.//**.FILE.** selects any data set whose first index is “PAYROLL”, whose second index consists of at least two characters, and has any number of following index levels, one of which must be “FILE”, such as:

PAYROLL.DCLX5.FILE 
PAYROLL.AB.FACTORY1.FILE.OCT90 
PAYROLL.FACTORY2.HISTORY.FILE

With the same mask, FDREPORT selects only data sets with at least one index level after the index “FILE”.

Generic DSN selection example 8

Filter **.G++++V00 selects all generations of any Generation Data Group (GDG). In ABR, you can do this more easily with the GDG operand, but this may be useful in other programs that support generic data set selection.

Generic DSN selection example 9

Filter **MASTER(-1) selects the –1 generation of any GDG whose name ends in “MASTER”, such as:

PROD1.WEEKLY.WIDGET.MASTER(-1) 
FINANCE.GLEDGER.XMASTER(-1)

This only works when selecting data sets from the catalog (such as the CATDSN= operand).

Generic DSN selection example 10

Filter ** selects all data sets.

Warning

Use “**” with care, especially when doing ARCHIVE or Superscratch.

Selecting data sets from the catalog

When generic data set selection is used to select data sets from system catalogs (such as the CATDSN= operand in ABR and FDRCOPY or the DATATYPE=CATALOG or CATVTOC in FDREPORT), one or more system catalogs are searched depending on the filter specified.

By default, the search starts with the master catalog; if aliases are encountered which match the filter, the associated user catalogs are searched as well. If there are enough explicit characters at the beginning of the filter, the search may be limited to one or a small number of user catalogs. For example, a filter of AB** means that only those user catalogs associated with aliases beginning with AB need be searched. However, if the filter begins with generic characters (such as **AB), then every user catalog with an associated alias in the master catalog must be searched. Although the catalog search is designed to be as efficient as possible, reading the catalogs directly whenever possible, this may still be a time-consuming process.

The name of a catalog to search can be specified instead of going through the master catalog; in ABR and FDRCOPY specify the CATALOG= parameter. In this case, only data sets in that catalog are selected; no other catalogs are searched even if they exist as user catalogs in that catalog. If you want to start your search with a master catalog that is not the master catalog of the system you are executing on, specify MCATALOG= instead and aliases are searched. However, ABR and FDRCOPY do not use this catalog name when they are updating or deleting catalog entries; the IBM standard catalog search order is used.

Generation Data Groups (GDGs) are treated specially when selected from a catalog:

  • The filter is compared to the GDG base name (without the GnnnnVnn absolute generation). If it matches the base, then all generations in that GDG are selected (unless limited by CATLIMITGDG= as shown below).
  • The filter is also compared to the full name of each generation (including the GnnnnVnn). All generations that match the filter are selected.
  • If the filter ends in a relative generation number in parenthesis (for example, “PAYROLL.**(–n)” or “PAYROLL.**(0)”), then only that generation is selected from any GDGs selected (and the filter does not select any non GDG data sets).
  • In ABR and FDRCOPY you can specify CATLIMITGDG=-n and only the (–n) generation of any GDG data sets that match the filter are selected. However, the filter may also select non GDG data sets.
  • In ABR and FDRCOPY, you can also specify CATLIMITGDG=n and only the most recently created “n” generations of any GDG data sets that match the filter are selected. The filter may also select non GDG data sets.
  • For SMS-managed GDG data sets, any generations in rolled-off or deferred roll-in status are NOT considered part of the GDG for selection; they are treated as normal non GDG data sets.

For VSAM clusters, the filter is only compared to the base cluster name. Component names, PATH names and AIX (alternate index) cluster and component names are not tested.

It is possible to assign aliases to non-VSAM data sets. These aliases are complete alternate names by which a data set can be referenced and are not related to the aliases assigned to catalogs to control which data sets are in a given catalog. The filter never selects alias names; it is tested only against the true name of every data set.

If an alias is encountered in a master catalog which points to a user catalog on a volume that is not currently mounted (or does not exist) that catalog is bypassed.

By default, any errors scanning the catalogs (errors opening a catalog or internal errors in a catalog) results in a diagnostic message. In ABR and FDRCOPY, the operand CATBYPERR bypasses printing errors for catalog opens; internal errors are still reported.

Selecting data sets from other sources

When generic data set selection is used to select data sets from sources other than the system catalogs (such as VTOCs or the Archive Control File), then the entire source is scanned, since the names may be in random order. Each data set name taken from the input is processed against all of the data set filters (such as multiple SELECT statements in ABR, DSF, and FDRCOPY).

GDG generations are treated as normal data sets. There is no provision for selecting by relative generation number. It is not sufficient for the filter to match on just the GDG base name; the filter must take into account the GnnnnVnn absolute generation number at the end (for example, “PAYROLL.MASTER.**” or “PAYROLL.MASTER.G*”).

For VSAM clusters, the filter is only compared to the base cluster name; component names and AIX names are not tested. However, FDREPORT tests component names.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*