SCANPDS - Search and Cross-Reference PDS Members and Libraries

                     

Overview

SCANPDS is a multi-function utility program which scans partitioned data sets (PDS & PDSE), lists directories, cross-references the members they contain, and prints records matching specified search arguments. SCANPDS runs in the TSO/E environment (batch or on-line) on MVS/ESA, OS/390 and z/OS.

SCANPDS is a high-performance tool designed to help programmers, consultants and auditors obtain quick answers to a variety of questions, such as the following:

  • How many versions of our payroll programs do we have ? In what libraries can we find the source code and load-modules? When were they modified or link-edited?
  • What procedures contain an EXEC PGM=PAY234R5 statement? In what libraries are they stored? Which one is the most recent?
  • Do we have any members in ISPF PACK format in our source libraries? If we do, where are they? Is the content of any of these members corrupted?
  • Do we have duplicate programs in our system libraries? Are they different from one another ?
  • What PDS members refer to the CP3UU7J COPY member ? What JCL members execute PGM=PAYDAY34 ?
  • What programs in what libraries refer to field CVTUSER ?
  • What PARMLIB and Link-List members were modified or link-edited last week?

Highlights         Top of the Page

SCANPDS performs the following:

  1. Search on-line catalogs or VTOCs for data set names matching a list of user-specified selection criteria, using wildcards such as SYS%.** or %%P.LIB*.SOURCE*.** or fully-qualified names such as PROD.AR.SOURCE.
  2. Read directories and select members based upon a list of user-specified selection criteria, such as members whose names match specified names or patterns, duplicate members, members in ISPF packed format, empty members, members updated by specified TSO users, members modified or link-edited within a specified range of dates, etc
  3. List selected directory entries in member name sequence, along with ISPF statistics, link-edit date and load-module attributes
  4. Optionally read members from selected libraries, search for specified character strings and display matching records. Process record sizes up to 32760 and unpack members in ISPF PACK format, as necessary.

SCANPDS supports PDS and PDSE libraries and does not normally update the "last-reference" date in the data set's VTOC entry (format-1 DSCB). SCANPDS is designed for speed and uses various techniques to reduce run time, I/O activity, and CPU consumption.

SCANPDS does not support the EDIT or SCRATCH functions to update or delete PDS members, but we also distribute two products which support them; they are PDSEDIT and SCRATCH

SCANPDS is an affordable product. A free, time-limited version is available for evaluation. Sample output reports are available for viewing.

Command Syntax         Top of the Page

SCANPDS is a TSO/E command and standard TSO/E rules for command syntax apply. Below is a list of options and parameters which can be specified. Please refer to the sample JCL for coding examples.

SCANPDS (defaults)
(library filter keys) Mandatory
EXCLUDE(exclude filters) n/a
MEMBERS(member filters) *
EXCLUDEMEMBERS(member filters)  n/a
USERID(user-ID filters) n/a
EXCLUDEUSERID(user-ID filters) n/a
CATALOG(catalog name) n/a
ENTTYPE(catalog entry types) A
VOLUMES(volume list) n/a
FROM(from-date) n/a
TO(to-date) n/a
FIND(search strings) n/a
BOUNDS(n,m) 1,&LRECL
CAPS|ASIS ASIS
LANGUAGE(ASM|COBOL|JCL) n/a
FIRST|FIRST(n)|LAST|ALL ALL
PREFIX|SUFFIX|WORD n/a
INSYNC|SUPERC|PDSM18 INSYNC
MBRSEQ(NAME|TTR) See Comments
MOUNT|NOMOUNT NoMount
RECALL|NORECALL NoRecall
RACHECK|NORACHECK Racheck
FORMAT1|FORMAT2|FORMAT3 Format2
DUPLICATES|NODUPLICATES|ALL ALL
LINKDATE|NOLINKDATE NoLinkdate
LoadLibraries(EVEN|ONLY|NONE) EVEN
PACKED|NOPACKED n/a
UNPACKED|NOUNPACKED n/a
PACKERROR|NOPACKERROR n/a
EMPTY|NOEMPTY n/a
IOERROR|NOIOERROR n/a
PUTLINE|SYSPRINT(dsname) See comments
LastReferenceDate(Keep|Update|Conditional)  Keep
SortLibraryList See comments
MAXTASKS(n) 20

Migrated Data Sets         Top of the Page

SCANPDS detects data sets migrated by HSM, FDR/ABR and CA-DISK and ignores them unless the RECALL option is specified. Specifying RECALL(DISK), RECALL(TAPE) or RECALL(BOTH) recalls data sets migrated to disk, tape, or both, respectively. Specifying RECALL is equivalent to RECALL(BOTH). As expected, specifying RECALL has a severe impact on performance, particularly when data sets have to be recalled from tape.

Members in ISPF PACKED Format         Top of the Page

SCANPDS fully supports members in ISPF PACKED format. When the PACKED, UNPACKED or PACKERROR options are specified, SCANPDS reads members to identify those in PACKED format, members which are not in PACKED format, or members in PACKED format for which the unpacking routine detects an error. Specifying the PACKED, UNPACKED or PACKERROR options increases I/O activity; specifying PACKERROR also increases CPU consumption.

The FIND option automatically unpacks packed members before searching for specified arguments and displays unpacked records on the FINDOUT data set.

ALIAS Catalog Entries         Top of the Page

SCANPDS does not currently support ALIAS entries in the catalog.

ALIAS Directory Entries         Top of the Page

SCANPDS currently ignores the ALIAS bit in directory entries. As a result, those entries are supported like non-ALIAS members.

ALIAS names can be 1 to 8 characters; longer ALIAS names that can exist in a PDSE are not supported.

FIND Option         Top of the Page

The FIND option searches PDS and PDSE members for specified arguments; matching records are printed to the FINDOUT data set. Specifying the FIND option increases I/O activity and CPU consumption.

FIND works in association with a set of related options, namely BOUNDS, WORD, PREFIX, SUFFIX, CAPS, ASIS, FIRST, LAST, ALL and LANGUAGE. Except for LANGUAGE, FIND and associated options work like the corresponding options of the ISPF and SDSF FIND commands.

The FIRST(n) or LAST(n) options (which do not exist in the FIND commands of ISPF or SDSF) instruct SCANPDS to print the first (or last) n matching records for each member. FIRST and LAST are equivalent to FIRST(1) and LAST(1), respectively.

The LANGUAGE(ASM), LANGUAGE(COBOL) or LANGUAGE(JCL) options indicate that comment lines should not be searched for matching arguments. Assembler comments are identified by the presence of an asterisk in pos 1 or 2 of the record. COBOL comments are identified by the presence of an asterisk or a slash in pos 7 of the record. JCL comments are identified by the presence of an asterisk in pos 3 of the record.

FIND operates on load-libraries in PDS or PDSE format. However, results from a load-library search may be confusing, as the matching arguments may not always appear in the FINDOUT output.

FINDOUT Data Set         Top of the Page

The FINDOUT data set is used in conjunction with the FIND option of SCANPDS. When records matching the FIND arguments are found, they are printed to the FINDOUT DD. The default DCB attributes for FINDOUT are RECFM=VBA,LRECL=260. If matching records can be longer than 255 bytes, then an appropriate value equal to 5 plus the length of the longest matching record must be specified on the FINDOUT DD, e.g. LRECL=1005 will accomodate 1000-byte records. The RECFM for FINDOUT is always set to VBA and cannot be changed.

By default, the output written to FINDOUT is displayed in the COMPACT format, which includes the data-set and member names, and ISPF statistics (when present). For example, here is some of the output produced by the following TSO/E command: SCANPDS IBMUSER.JCL FIND('PGM=IEB' 'PGM=IEH'):

1IBMUSER.JCL(ASCII)  01.04 1997-06-17 1997-06-27 15:00:00     23     9    15 IBMUSER
 //LABEL EXEC PGM=IEBGENER                                               00060001
 //PRINT EXEC PGM=IEBGENER                                               00130001
 //PRINT2 EXEC PGM=IEBGENER                                              00190004
0IBMUSER.JCL(FREEBEES)  01.06 1992-05-21 1997-06-03 09:56:32     20    24     0 IBMUSER
 //COPY    EXEC PGM=IEBCOPY
0IBMUSER.JCL(IEHMOVE2)  01.03 1994-04-04 1999-12-28 12:27:48     17    16    10 IBMUSER
 //RELOAD EXEC PGM=IEHMOVE,PARM='POWER=4'                                00090000 

When the INSYNC option is specified, the format of the output written to FINDOUT is similar to that produced by the INSYNC utility; for example, here is some of the output produced by this command:   SCANPDS GSFSOFT.ESA43.MACLIB MEM(IHA*) XMEM(IHAASCB) FIND(ASCB) WORD INSYNC

  IHAASEO  ----------- GSFSOFT.ESA43.MACLIB ------------------------------------
ASEOSTKN DS    XL8                     64-bit stoken of new ASCB
ASEOASCB DS    A                       ASCB of new address space
*          3 ASEOSTKN BIT(64),         /* 64-bit stoken of new ASCB  */
*          3 ASEOASCB PTR(31),         /* ASCB of new address space  */
  IHAASSB  ----------- GSFSOFT.ESA43.MACLIB ------------------------------------
.*  $L9=ASCB     HBB4410  880404   PD16BN:  ASCB VSCR SUPPORT
ASSBASCB DS    A                   ADDRESS OF ASCB.                @L9C
*      2 ASSBASCB PTR(31),          /* ADDRESS OF ASCB.          @L9C*/
  IHAASTE  ----------- GSFSOFT.ESA43.MACLIB ------------------------------------
*                                  ASCB ADDRESS                    @L2A
*                                     ASCB ADDRESS.              @L2C*/
  IHAASVT  ----------- GSFSOFT.ESA43.MACLIB ------------------------------------
*                                  CONTAINS ADDRESS OF ASCB. IF NOT
*                                    CONTAINS ADDRESS OF ASCB. IF NOT
  IHAASXB  ----------- GSFSOFT.ESA43.MACLIB ------------------------------------
*/*     control.  The ASXB is swappable, and the ASCB is not.        */ 

When the SUPERC option is specified along with FIND, the format of the output written to FINDOUT is similar to that produced by the SEARCHFOR command of the IBM SUPERC utility; for example, here is some of the output produced by this command:   SCANPDS GSFSOFT.ESA43.MACLIB MEM(IHA*) XMEM(IHAASCB) FIND(ASCB) WORD SUPERC

GSF Utilities - SCANPDS R401I                            Monday 27 Dec 2004 (2004.362) 16.36
 LINE-#  SOURCE SECTION                    SRCH DSN: GSFSOFT.ESA43.MACLIB

 IHAASEO                     --------- STRING(S) FOUND -------------------

     38  ASEOSTKN DS    XL8                     64-bit stoken of new ASCB
     39  ASEOASCB DS    A                       ASCB of new address space
     53  *          3 ASEOSTKN BIT(64),         /* 64-bit stoken of new ASCB  */
     54  *          3 ASEOASCB PTR(31),         /* ASCB of new address space  */

 IHAASSB                     --------- STRING(S) FOUND -------------------

     98  .*  $L9=ASCB     HBB4410  880404   PD16BN:  ASCB VSCR SUPPORT
    291  ASSBASCB DS    A                   ADDRESS OF ASCB.                @L9C
    582  *      2 ASSBASCB PTR(31),          /* ADDRESS OF ASCB.          @L9C*/

 IHAASTE                     --------- STRING(S) FOUND -------------------

    159  *                                  ASCB ADDRESS                    @L2A
    262  *                                     ASCB ADDRESS.              @L2C*/

 IHAASVT                     --------- STRING(S) FOUND -------------------

    120  *                                  CONTAINS ADDRESS OF ASCB. IF NOT
    199  *                                    CONTAINS ADDRESS OF ASCB. IF NOT

 IHAASXB                     --------- STRING(S) FOUND -------------------

     50  */*     control.  The ASXB is swappable, and the ASCB is not.        */ 

When the PDSM18 option is specified along with FIND, the format of the output written to FINDOUT is similar to that produced by the PDSM18 utility (PDSMAN), as shown below:

GSF Utilities - SCANPDS R401I                            Monday 27 Dec 2004 (2004.362) 16.36
** PDSM18 **   SYS1                                       GSFSOFT.ESA43.MACLIB
NO TARGET STRINGS FOUND   IN MEMBER IHAABDPL
NO TARGET STRINGS FOUND   IN MEMBER IHAABEPL
NO TARGET STRINGS FOUND   IN MEMBER IHAACEE
NO TARGET STRINGS FOUND   IN MEMBER IHAAE
NO TARGET STRINGS FOUND   IN MEMBER IHAAQAT
NO TARGET STRINGS FOUND   IN MEMBER IHAARL

 FLG LINENO --- HIT(S)        FOUND FOR MEMBER IHAASEO       ---

 HIT    38  ASEOSTKN DS    XL8                     64-bit stoken of new ASCB
 HIT    39  ASEOASCB DS    A                       ASCB of new address space
 HIT    53  *          3 ASEOSTKN BIT(64),         /* 64-bit stoken of new ASCB  */
 HIT    54  *          3 ASEOASCB PTR(31),         /* ASCB of new address space  */

 FLG LINENO --- HIT(S)        FOUND FOR MEMBER IHAASSB       ---

 HIT    98  .*  $L9=ASCB     HBB4410  880404   PD16BN:  ASCB VSCR SUPPORT
 HIT   291  ASSBASCB DS    A                   ADDRESS OF ASCB.                @L9C
 HIT   582  *      2 ASSBASCB PTR(31),          /* ADDRESS OF ASCB.          @L9C*/

 FLG LINENO --- HIT(S)        FOUND FOR MEMBER IHAASTE       ---

 HIT   159  *                                  ASCB ADDRESS                    @L2A
 HIT   262  *                                     ASCB ADDRESS.              @L2C*/

 FLG LINENO --- HIT(S)        FOUND FOR MEMBER IHAASVT       ---

 HIT   120  *                                  CONTAINS ADDRESS OF ASCB. IF NOT
 HIT   199  *                                    CONTAINS ADDRESS OF ASCB. IF NOT

 FLG LINENO --- HIT(S)        FOUND FOR MEMBER IHAASXB       ---

 HIT    50  */*     control.  The ASXB is swappable, and the ASCB is not.        */ 

Sample JCL         Top of the Page

SCANPDS runs as a TSO command on-line or in batch. The following sample job stream shows how to set up a TMP job step to execute several SCANPDS commands.

 //SCANPDS3 JOB (acct#),'PDS XREF',CLASS=A,MSGCLASS=X,COND=(0,NE)
 //*
 //*		Cross-Reference MVS Libraries
 //*
 //PDSSCAN EXEC PGM=IKJEFT01
 //STEPLIB  DD DSN=<SCANPDS Load Library>,DISP=SHR
 //SYSTSPRT DD SYSOUT=*
 //SYSPRINT DD SYSOUT=*
 //FINDOUT  DD SYSOUT=*
 //SYSTSIN  DD *

 /* List the directory for SYS1.MACLIB */

 SCANPDS SYS1.MACLIB

 /* List duplicate members in PROD.LOADLIB and STAGE.LOADLIB

 SCANPDS (PROD.LOADLIB STAGE.LOADLIB) DUPLICATES

 /* List duplicate IEF anf IGG load-modules in system libraries,
 /* along with the corresponding link-edit dates

 SCANPDS (LINKLIST LPALIST) MEMBERS(IEF* IGG*) DUPL LINKDATE

 /* Scan JCL libraries to locate packed members
 /* Recall migrated libraries.

 SCANPDS (GSFSOFT.**.*JCL*.** PRJ144.JCL*.**) PACKED RECALL

 /* Search all PROD.** and STAGE.** source libraries in the catalog
 /* for members modified by GSFSOFT and STAFF*. Scan those members for
 /* records containing the 'CP3UU7J' or 'CP4RS4D' character strings.
 /* Ignore COBOL Comment lines.

 SCANPDS (PROD.** STAGE.**) +
	USERID(GSFSOFT STAFF*) +
	FIND(CP3UU7J CP4RS4D) +
	LANG(COBOL)

 /* Cross-reference duplicate members whose names match IEC* and *JEK*
 /* display load-module link-edit dates


 SCANPDS (**.LOAD* **.LINK* **.PARMLIB) +
	EXCLUDE(SYS%.** DLIB.**) +
	MEMBERS(IEC* *JEK*) +
	DUPLICATES +
	LINKDATE

 /* Search system and DLIB source libraries for IHA* and IGG*
 /* members which contain the 'PSA' or 'ASCB' character strings
 /* in pos 8 through 44 of each record.
 /* Ignore assembler comment lines with '*' in pos 1 or 2.
 /* Print only the first two matching records of each member.

 SCANPDS (SYS1.AOS* SYS1.MACLIB SYS1.MODGEN) +
	EXCLUDE(SYS1.AOS34 SYS1.AOS5* ) +
	LOADLIB(NO) +
	MEMB(IHA* IGG*) +
	FIND('PSA' 'ASCB') +
	BOUNDS(8,44) +
	LANG(ASM) +
	FIRST(2)

 /* List PARMLIB and link-list members updated during
 /* the first seven days of February 2004.

 SCANPDS (parmlib linklist) from(20040201) to(20040207)

 /* List all members in all SYS%.** uncatalogued data sets on specified on-line DASD volumes

 SCANPDS SYS%.** VOL(Z%RES% Z%USS%)

 /* List all empty members found in all catalogued data sets whose dsnames end with CTLCARDS 

 SCANPDS **.CTLCARDS EMPTY
/* 

Sample Output Reports         Top of the Page

Sample output listings produced by SCANPDS are available here and here.

Search key-words: ibm mvs os/390 os390 z/os zos tso ispf clist rexx exec list directory list directories liste listing global search members searching pds mass scan text plus scanning test locate locating fast cross-reference quick crossreference rapid xref crossref cross-ref idrdata create created modify change modified changed pds pdse pds/e dataset datasets mbrxref2 generic wildcard wildcards wild-card wild-cards partially-qualified fully-qualified jcl job stream listds listpds pdslist listdir iehlist srchfor srchdsn 5798-CXQ FDP replacement masse system-wide sequential mainframe main-frame superc isrsupc concatenation BUSCAR TODAS LIBRERIAS dynamically allocate gives produces i/o error