You can create dynamic PDSs with JCL, by using the extension syntax illustrated in the following examples.
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 |
//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.
//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.
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.