Creating a Dynamic PDS with JCL

You can create dynamic PDSs with JCL, by using the extension syntax illustrated in the following examples.

You must set the following variables in your JCL depending on whether the file is for data or source.
Variable Value for a data PDS Value for a source PDS
LRECL Any number greater than zero 0
RECFM Either FB, V, VB, or F LSEQ

Using a PDS for data files

//DD1      DD DSN='TEST.DYN1',DISP=(NEW,CATLG), 
//            DCB=(RECFM=FB,LRECL=123,DSORG=PO) 
//*MFE: %PCDSN=C:\DPDS\*.DAT

This will create TEST.DYN1 as a dynamic PDS whose members are files in the directory C:\DPDS with the extension .DAT.

Using a PDS for source files

//DD1      DD DSN='LORINCE.CTLLIB.PDS',DISP=(NEW,CATLG),
//            UNIT=SYSDA,SPACE=(CYL,(3,1,1)),
//            DCB=(RECFM=LSEQ,LRECL=0,DSORG=PO)
//*MFE: %PCDSN=C:\DCCPDS\*.TXT

This will create LORINCE.CTLLIB.PDS as a dynamic PDS that can be used for control cards or source for SORT, IDCAMS, REXX, JCL, and PROCs.

Deleting a Dynamic PDS

When you delete a dynamic PDS, this does not automatically delete the underlying PC files. To delete the underlying PC files, set the MF_DEL_DYNPDS environment variable to Y.