Dynamic PDSs

In MSS, each member of a PDS is implemented as a separate physical PC file. By default, you have to create a separate catalog entry for each such member, giving the filename of the physical file. This is not practicable if a PDS has a great many members. You can avoid it by using a dynamic PDS.

To define a dynamic PDS you create just one catalog entry. On its Catalog Entry page in ESMAC, you set the DS Org field to PO and then put a check mark by Dynamic PDS. This enables the Physical Filename and PDS Exts fields. The value you enter in the Physical File field is assumed to be the name of an existing directory. The members of the PDS are implemented as individual physical files within this directory.

The Physical Filename field must end with a backslash ("\") on Windows or a forward slash ("/") on UNIX. As in any catalog entry, it must specify the full path. You can use the string "<CATALOGFOLDER>" to represent the directory where the catalog is stored.
Restriction: No other formats for the Physical Filename (for example paths containing an environment variable) are supported.

In the PDS Exts field you can specify what files to include by typing in a list of one or more filename extensions separated by spaces, or, to include all files regardless of the filename extension and to also include files that have no filename extension at all, specify * (asterisk).

On UNIX, all member names used in a dynamic PDS must be upper case. Any file that uses a lower case member name will not be found.

Example

If you define a Catalog Entry with

Field Value
DS Name SOURCE.PDS
Physical Filename <CATALOGFOLDER>\PAYROLL\
DS Org PO
Dynamic PDS checked
PDS Exts *

where the catalog folder is C:\CATALOG, and you then run the following JCL:

/FILE1	   DD DSN=SOURCE.PDS(PAYUPD),DISP=OLD
/FILE2	   DD DSN=SOURCE.PDS(PAYREP),DISP=OLD

(note DISP=OLD because SOURCE.PDS already exists), then as long as ES_OLD_DYN_PDS=Y is set then the JCL creates physical files PAYUPD.CBL and PAYREP.CBL in directory C:\CATALOG\PAYROLL. It creates catalog entries for these individual PDS members (DSOrg = PDSM) automatically. If ES_OLD_DYN_PDS=N (the default) is set, physical files for the PDS members are only created and cataloged when you run JCL similar to that outlined in Creating a Dynamic PDS with JCL.

When a PDS member is being sought, the directory is searched for a file with the member's name plus each of the specified extensions in turn, and the first match is used. For example, if the directory contains PAYUPD.CBL, PAYUPD.CPY and PAYREP.CPY, then an attempt to access SOURCE.PDS(PAYUDP) will find PAYUPD.CBL. Because the search terminates once a match has been found, PAYUPD.CPY will never be found. An attempt to access SOURCE.PDS(PAYREP) will find PAYREP.CPY.