Name
catsearch — list z/OS catalogs
Synopsis
catsearch [-l] [-t[delim_char]] [-mmax_entries] [-eentry_types] [-R]filter_keycatsearch [-x] [-eentry_types]filter_key
Description
This z/OS Co:Z utility command wraps the Catalog Search Interface (IGGCSI00)
and provides a convenient display of information about the Datasets that match the
supplied filter_key.
The syntax of the filter_key and additional documentation can be found in the following IBM publication: DFSMS: Managing Catalogs - SC26-7409.
Note: Because filter keys typically make heavy use of the asterisk (*) character, it is a best practice to quote this argument when issuing the catsearch command from a Unix System Services shell. This will prevent the shell from expanding the argument. The examples below show the filter key argument in quotes for this reason.
Listing the entire catalog (filter_key **) is dis-allowed.
Options
-lRequests long form information about the listed Datasets. This information includes Volume, last referred date, tracks, used, recfm, lrecl, blocksize, dsorg and Dataset name.
-tRequests long form information about the listed Datasets in delimited format. If
delim_charis supplied, it is used as a delimiter, otherwise a tab character (\t) is used.-mmax_entriesChanges the maximum number of entries that will be returned by catsearch. the default is
2000.-eentry_typesChanges the default entry type filter for catsearch. The default, if not specified, is
ABCGHRU. Refer to z/OS DFSMS Managing Catalogs: Catalog Search Interface for more information..-RTurns off data set alias resolution. It is on by default.
-xSets the exit code based on entries found. Entries found are not listed. With this option the following are ignored:
-l,-t, and-m.The exit code is set according to the following:
0 - no entries found
1 - one entry found
2 - more than one entry found
4 or greater - IGGCSI00 error (the return code)
Examples
This example shows a long listing
-lform of a catsearch.>catsearch -l "user.coz.**" Volume Referred Ext Tracks Used Recfm Lrecl BlkSz Dsorg Dsname WORK81 2008/09/24 1 30 ? U 0 6144 PO-E USER.COZ.LOADLIB WORK81 2008/09/24 1 15 4 FB 80 27920 PO USER.COZ.SAMPJCL WORK84 2008/09/11 1 1 1 U 0 6144 PS USER.COZ.TEST.SEQ WORK81 2008/09/24 1 15 4 FB 80 27920 PO USER.COZ.TESTJCL
This example shows the difference between the single and double asterisk filter key symbols. A single asterisk only lists datasets within the current segment; the double asterisk will span segments.
>catsearch -l "user.coz.*" Volume Referred Ext Tracks Used Recfm Lrecl BlkSz Dsorg Dsname WORK81 2008/09/24 1 30 ? U 0 6144 PO-E USER.COZ.LOADLIB WORK81 2008/09/24 1 15 4 FB 80 27920 PO USER.COZ.SAMPJCL WORK81 2008/09/24 1 15 4 FB 80 27920 PO USER.COZ.TESTJCL >catsearch -l "user.coz.**" Volume Referred Ext Tracks Used Recfm Lrecl BlkSz Dsorg Dsname WORK81 2008/09/24 1 30 ? U 0 6144 PO-E USER.COZ.LOADLIB WORK81 2008/09/24 1 15 4 FB 80 27920 PO USER.COZ.SAMPJCL WORK84 2008/09/11 1 1 1 U 0 6144 PS USER.COZ.TEST.SEQ WORK81 2008/09/24 1 15 4 FB 80 27920 PO USER.COZ.TESTJCLShows the use of the
-dswitch. Note that only the partial (pseudo directory) is listed forUSER.COZ.TEST, and that there is no accompanying detailed information. Use of this option can be helpful when dealing with large catalogs.>catsearch -dl "user.coz.**" Volume Referred Ext Tracks Used Recfm Lrecl BlkSz Dsorg Dsname WORK81 2008/09/24 1 30 ? U 0 6144 PO-E USER.COZ.LOADLIB WORK81 2008/09/24 1 15 4 FB 80 27920 PO USER.COZ.SAMPJCL USER.COZ.TEST WORK81 2008/09/24 1 15 4 FB 80 27920 PO USER.COZ.TESTJCLShows the use of the
-xswitch. For illustration, the example below first shows a long listing using filter keyuser.coz.*. The result contains 3 datasets. The exit code using the-xswitch and the same filter key is2indicating more than one entry found. The exit code is displayed byecho $?.>catsearch -l "user.coz.*" Volume Referred Ext Tracks Used Recfm Lrecl BlkSz Dsorg Dsname WORK81 2008/09/24 1 30 ? U 0 6144 PO-E USER.COZ.LOADLIB WORK81 2008/09/24 1 15 4 FB 80 27920 PO USER.COZ.SAMPJCL WORK81 2008/09/24 1 15 4 FB 80 27920 PO USER.COZ.TESTJCL >catsearch -x "user.coz.*" >echo $? 2
