Temporary data sets

A temporary data set is a data set that is created and deleted in the same job, and is identified by coding one of the following:
  DSNAME=&&dsname
For a temporary data set
  DSNAME=&&dsname(member)
For a member of a temporary PDS or PDSE
  No DSNAME parameter
For a temporary data set to be named by the system
Additionally, in a non-SMS environment only, the system treats any data set that is created and deleted in the same job step as a temporary data set. For example, the system treats a data set coded as:
DSN=A.REAL.DSN.NAME,DISP=(NEW,DELETE)  
in a non-SMS environment as a temporary data set.

Only the job that creates a temporary data set has access to it to read and write data and to scratch the data set.

SMS manages a temporary data set if (1) you specify a storage class (via the DD STORCLAS parameter) or (2) an installation-written automatic class selection (ACS) routine selects a storage class for the temporary data set.

The system generates a qualified name for the temporary data set. For details about the format of the name the system generates, see the description of the DSNAME parameter in z/OS MVS JCL Reference.

The time in the system-generated qualified name is the same for all temporary data sets in a job. Therefore, if the same temporary data set name appears more than once in a job, the system might create duplicate data set names. This would be a JCL error, unless the data set is passed from one job step to another.

If the DISP parameter for a temporary data set specifies KEEP or CATLG, the system changes the disposition to PASS and deletes the data set at job termination. However, the system does not change the disposition for a data set when all of the following are true:

In this case, the system deletes the data set at job termination but tells the operator to keep the volume for the data set.

Examples

//TEMPDS1  DD  DSNAME=&&MYDS,DISP=NEW,UNIT=SYSDA,
//        SPACE=(CYL,20)

//TEMPDS2  DD  DSNAME=&&DSA,DISP=(NEW,PASS),UNIT=3380,
//        SPACE=(TRK,15)

//TEMPSMS  DD  DSNAME=&&ABC,DATACLAS=DCLAS2,STORCLAS=TEMP1,DISP=NEW