DD DISP parameter in jcl

What is the function of DD DISP parameter ?


The DISP parameter tells the disposition of the dataset. Go through the following syntax and examples with screen shots for better understanding of the concept.

Syntax:

DD DISP=(Status,normal-disposition,abnormal-disposition)

Explanation:

Status: The status field tells the current status of a dataset i.e, whether dataset is exists or has to be created. Status values can be NEW,OLD,MOD,SHR

NEW: Status of the dataset is new and is not already exists. Going to create the new dataset

OLD: Dataset is already present.

MOD: Dataset may or may not exists. If not exists creates the new dataset. If exists then it's purpose is same as OLD.

SHR: Dataset can be used by multiple jobs at same time for read purpose

Normal-disposition: What to do with the dataset upon successful run of job(normal-termination of job).

Normal-disposition values can be CATLG,DELETE,PASS,KEEP

CATLG: Save the dataset and creates the catalog entry.

DELETE: Delete the dataset

PASS: Pass the dataset to the next steps. After completion of job run delete the dataset

KEEP: Keep the dataset. But no information will be available in catlog table about the dataset.

Abnormal-disposition: What to do with the dataset upon unsuccessful run of job(abnormal-termination of job).

abnormal-disposition values can be CATLG,DELETE,KEEP


Example screen shots

The Following example screen shots shows how we use the DISP parameter in JCL

DISP=SHR

Screen shot which shows how to use DISP=SHR option in JCL
Screen shot which shows how to use DISP=SHR option in JCL

In the above example File TEST.INPUT.FILE1 is used in shared mode. Shared mode means that when the file is used by the job A in shared mode, job B, job C ..etc can also use the same file in shared mode.

DISP=(NEW,CATLG,DELETE)

Screen shot which shows how to use DISP=(NEW,CATLG,DELETE) option in JCL
Screen shot which shows how to use DISP=(NEW,CATLG,DELETE) option in JCL

DISP=(MOD,CATLG,DELETE)

Screen shot which shows how to use the DISP=(mod,catlg,delete) option in JCL
Screen shot which shows how to use the DISP=(mod,catlg,delete) option in JCL

Alternate Syntax for DISP=(MOD,CATLG,DELETE)

Screen shot which shows the alternate syntax for DISP=(mod,catlg,delete)
Screen shot which shows the alternate syntax for DISP=(mod,catlg,delete)

DISP=(OLD,CATLG,DELETE)

Screen shot which shows the how to use DISP=(old,catlg,delete) option in JCL
Screen shot which shows the how to use DISP=(old,catlg,delete) option in JCL

More by this Author


Comments

No comments yet.

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.


    Click to Rate This Article
    working