JCL DD DISP

JCL – DD DEST JCL – DD DSNAME

Advertisements


DISP parameter describes the status of the dataset.

DISP parameter also describes the system what to do with the dataset after the job step termination.

DISP stands for DISPOSITION.

DISP is an optional parameter.

DISP parameter can be specified for normal termination and one for abnormal termination.

Dataset disposition controlled solely by DISP parameter.

It is used to describe the status of the dataset that is coded with the DD statement.

If the system obtains unit and volume information for an OLD, MOD, or SHR status, the data set is treated as if it exists or not physically on the device.


One of two methods can be used to request exclusive control:


  • DISP=NEW, DISP=MOD, or DISP=OLD on a JCL request.
  • DISP=NEW, DISP=MOD, or DISP=OLD on a dynamic allocation request.

Syntax:

	
{DISP=[status]                                                        }
{DISP=([status][,normal-termination-disp][,abnormal-termination-disp])}

DISP= ( [NEW] [,DELETE ] [,DELETE ] )
        [OLD] [,KEEP   ] [,KEEP   ]
        [SHR] [,PASS   ] [,CATLG  ]
        [MOD] [,CATLG  ] [,UNCATLG]
        [,  ] [,UNCATLG]
              [,       ]

If the any parameter ignored, then comma need to be coded to indicate the absence of the parameter.


STATUS:


STATUS parameter is used to specify the condition status of the dataset provided.

The Status parameter values of the dispositional parameters are given below.


Status Description
NEW Specifies the new dataset is to be created in the specified step.
SHR Specifies the data set exists before this step.

Other jobs can share the dataset and use the dataset at the same time.

This sub parameter can also be coded as SHARE.
OLD Specifies that the data set exists before this step.

The step specified requires exclusive (unshared) use of the data set.
MOD The data set exists before this step.

The records are to be added to the end of dataset.

The dataset must be sequential.

A new data set is to be created if dataset not existed.

If status parameter is ignored, the default value is NEW.

Normal-termination-disp:


Normal-termination-disp describes the system that what action needs to be performed on dataset when JOB step terminates normally.

Normal-termination-disp have the below list of values


  1. KEEP
  2. DELETE
  3. PASS
  4. CATLG
  5. UNCATLG

KEEP:

Inform to system that the dataset to be kept on the volume after step terminates successfully.

Keep will not alter any memory allocations done earlier for the dataset.


DELETE:

Inform to system that the dataset is no longer after step terminates successfully.

DELETE means making the memory available for other datasets usage.

The system physically erases the dataset if the erase option is in effect.

If the erase option is not in effect, the data will remain in DASD until the other dataset overrides.

If the EXPDT, RETPD set for the dataset, the datasets will be kept even though DISP coded with DELETE as Normal-termination-disp.

If new dataset is specified with DISP=(NEW,DELETE,), it will delete at the end of the step.


PASS:

Inform to system that the catalog entry needs to be placed after step terminates successfully.

Dataset is kept for CATLG entry if the step completed successfully.


CATLG:

Inform to system that the catalog entry needs to be placed after step terminates successfully.

Dataset is kept for CATLG entry if the step completed successfully.


UNCATLG:

Inform to system that uncatalog the dataset after step terminates successfully.

UNCATLG will do two tasks

  1. Removes entry in system or user catalog directory for dataset.
  2. All unneeded indexes will be deleted.

UNCATLG will not remove data from the dataset which was uncataloged.


Abnormal-termination-disp:


Abnormal-termination-disp describes the system that what action needs to be performed on dataset when JOB step terminates abnormally.

Abnormal-termination-disp have the below list of values.


  1. KEEP
  2. DELETE
  3. CATLG
  4. UNCATLG

KEEP:

Inform to system that the dataset to be kept on the volume after step terminates abnormally.

Keep will not alter any memory allocations done earlier for the dataset.


DELETE:

Inform to system that the dataset is no longer after step terminates abnormally.

DELETE means making the memory available for other datasets usage.

The system physically erases the dataset if the erase option is in effect.

If the erase option is not in effect, the data will remain in DASD until the other dataset overrides.

If the EXPDT, RETPD set for the dataset, the datasets will be kept even though DISP coded with DELETE as abnormal-termination-disp.

If new dataset is specified with DISP=(NEW,,DELETE), it will delete at the end of the step.


CATLG:

Inform to system that the catalog entry needs to be placed after step terminates abnormally.

Dataset is kept for CATLG entry if the step completed abnormally.


UNCATLG:

Inform to system that uncatalog the dataset after step terminates abnormally.

UNCATLG will do two tasks

  1. Removes entry in system or user catalog directory for dataset.
  2. All unneeded indexes will be deleted.

UNCATLG will not remove data from the dataset which was uncataloged.


Defaults and overrides:


  1. If the status subparameter ignored, the default is NEW.
  2. If the normal termination disposition subparameter ignored, the default is DELETE for a NEW data set or KEEP for an existing data set.
  3. If the abnormal termination disposition subparameter ignored, the default is the disposition specified or implied by the second subparameter.
  4. If the abnormal termination disposition subparameter ignored and the second subparameter specified as PASS, the default abnormal termination disposition is DELETE for a NEW data set or KEEP for an existing data set.
  5. If the DISP parameter ignored, the default is a NEW data set with a disposition of DELETE for both normal and abnormal termination disposition. i.e. DISP=(NEW, DELETE, DELETE).

Note:

The DISP parameter can’t be ignored for a data set that is created and deleted during a step.


Example 1:

//STEP01 EXEC PROG=SAMPLE
//DD1    DD    DSNAME=MTH.DATA.FILE,DISP=(NEW,CATLOG,DELETE),
//             DCB=(RECFM=FB,LRECL=425,BLKSIZE=18000),
//             SPACE=(50,10)

The statements requests that the system CATLOG the new data set if the step terminates normally and DELETE the dataset if the step terminates abnormally.


Example 2:

//STEP01 EXEC PROG=SAMPLE
//DD1    DD    DSNAME=MTH.DATA.FILE,
//             DCB=(RECFM=FB,LRECL=425,BLKSIZE=18000),
//             SPACE=(50,10)

The DISP parameter ignored in the above statement and DISP=(NEW,DELETE, DELETE) applies to the step. The statements requests that the system to DELETE the new data set even though the step terminates normally or abnormally.


Example 3:

//STEP01 EXEC PROG=SAMPLE
//DD1    DD    DSNAME=MTH.DATA.FILE,DISP=(OLD,KEEP,),
//             DCB=(RECFM=FB,LRECL=425,BLKSIZE=18000),
//             SPACE=(50,10)

The statement requests that the system KEEP the old data set if the step terminates normally.


Example 4:

//STEP01 EXEC PROG=SAMPLE
//DD1    DD    DSNAME=MTH.DATA.FILE,DISP=(NEW,PASS,),
//             DCB=(RECFM=FB,LRECL=425,BLKSIZE=18000),
//             SPACE=(50,10)

The statements requests that the system PASS the new data set to the next steps if the step terminates normally and DELETE the dataset if the step terminates abnormally.


JCL – DD DEST JCL – DD DSNAME

Advertisements