Let's understand Mainframe
Home Tutorials Interview Q&A Quiz Mainframe Memes Contact us About us

Module 4: JCL DD Statement


DD DISP(Disposition) Paramter

The DISP parameter, instructs the system as to the current status of a data set, and the steps to be taken with the data set upon successful or unsuccessful execution of job. It consist of three positional parameters and thus absence of any preceding parameter should be informed by coding ‘,’ (comma). Default is (NEW,DELETE,DELETE)

Syntax:-

DISP=(current-status,normal-end-status,abnormal-end-status)

Where,

current-status:- It defines the current status of dataset, i.e. whether it is already exist or has to be created.

Parameters:-

  • NEW - Dataset should be created (if you code this make sure file not exist already)
  • OLD - Dataset will be used by job exclusively
  • SHR - Dataset will be used by Job without exclusive access
  • MOD - Dataset will be created if doesn’t exist. If dataset already exist, data will be appended to existing file. This parameter enforce exclusive access

normal-end-status:- It defines how data set is to be disposed upon normal termination of job

Parameters:-

  • CATLG - Dataset will be catalogued
  • DELETE - Dataset will be deleted
  • KEEP - Dataset will be retained
  • PASS - Dataset will be passed to subsequent steps in the same job and will not be available at the end of the job
  • UNCATLG - Dataset is not catalogued which means you have specify volume number to access this data set down stream.

abnormal-end-status:- It defines how data set is to be disposed upon abnormal termination of job

Parameters:-

  • CATLG - Dataset will be catalogued
  • DELETE - Dataset will be deleted
  • KEEP - Dataset will be retained
  • UNCATLG - Dataset is not catalogued which means you have specify volume number to access this data set down stream.

Example:-

//JOB1 JOB A123,’STEVE’ //STEP1 EXEC PGM=PROGRAM1 //DATA1 DD DSN=DEPT1.EMP1.DATA1, // DISP=(NEW,CATLG,DELETE)

In this example,

  • NEW - DEPT1.EMP1.DATA1 does not exist and thus will be created
  • CATLG - Upon successful execution of job step, dataset will be cataloged
  • DELETE - Upon unsuccessful execution of job, dataset will be deleted.






© copyright mainframebug.com
Privacy Policy