DD RETPD Parameter


Note! RETPD parameter is required only when we are creating a dataset.

The RETPD parameter specifies the number of days that a dataset should be retained from the date of creation. This helps to reduce the risk of deleting the dataset accidentally. The dataset automatically deleted after retention period completed. RETPD is an optional parameter.

The RETPD parameter achieves the same result as the EXPDT parameter.

Syntax -

RETPD=nnnn
nnnn Specifies the retention period in days.
The nnnnn value is from 0 through 9999.
If the produced expiration date exceeds December 31, 2155, the expiration date will be set to December 31, 2155.
Note! Do not code the RETPD parameter for temporary datasets.

Examples -


Scenario1 - To retain a dataset for only 30 days.

//NEWPS  DD DSN=MTH.DATA.PSFILE,
//          DISP=(NEW,CATLG,DELETE),
//          UNIT=SYSDA,
//          SPACE=(TRK,(3,2),RLSE),
//          DCB=(DSORG=PS,RECFM=FB,LRECL=80,BLKSIZE=1600),
//          RETPD=30

Scenario2 - To retain a dataset for only 75 days.

//NEWPS  DD DSN=MTH.DATA.PSFILE,
//          DISP=(NEW,CATLG,DELETE),
//          UNIT=SYSDA,
//          SPACE=(TRK,(3,2,2),RLSE),
//          DCB=(DSORG=PO,RECFM=FB,LRECL=80,BLKSIZE=1600),
//          RETPD=75