Temporary datasets are created by
-
DSN=*
-
DSN=##TEMP
-
DSN=&&TEMP
-
By not specifying any DSNAME
Temporary datasets in JCL can be created by using DSN=&&TEMP syntax or by omitting the DSNAME parameter entirely. Both methods produce datasets that exist only for the duration of the job and are automatically deleted when the job completes.
In JCL, a temporary dataset exists only for the duration of the job/step and is not cataloged permanently. There are two standard ways to request one: explicitly coding DSN=&&name (the double-ampersand prefix, e.g., &&TEMP, flags it as temporary to the system), or simply omitting the DSNAME parameter altogether on a DD statement with DISP=(NEW,...) — the system then generates a temporary dataset name automatically and deletes it at job end (unless passed). DSN=* is invalid syntax for a dataset name, and DSN=##TEMP is not a recognized temporary-dataset naming convention (only && has that special meaning), so those two are wrong.