Sunday 28 July 2013

JCL DD Statement, Override DD Statement in JCL Example.

DD Statement
JCL DD Statement

In Today's JCL DD Statement or DD Statement in JCL, you learned how to code DD statements to allocate the DASD data sets that are processed by a job step. This tutorial precisely describes the JCL DD statement format with various DD statements examples. In addition, it shows you how to allocate special types of DASD data sets that you’ll only need in certain jobs. So, let's start with the tutorial. 

What is the JCL DD Statement?


JCL DD Statement stands for Data Definition (DD) statements. The DD statements are used to describe input/output data-sets for any COBOL program. The JCL DD statements are primarily defined after the EXEC statement that identifies the program. Normally, you code one DD statement for each data set your program will process.

The JCL DD statement provides the system with information about a data set, such as its organization, storage requirements, and record length, etc. 

The DD statement is the most complicated of all the JCL statements. This is because of the many parameters and subparameters it has, as well as the many ways you can code those parameters to allocate different types of data sets. 

How to code the JCL DD statement for DASD data sets?


Before explaining how to code a JCL DD statement. You need some overview of the different types of data sets in z/OS. 

IBM z/OS mainframe operating system provides a variety of data sets that are evolving, with new features added and older form retain for compatibility. Many of the new features come through SMS. Some SMS need to be active only at your installation.

Others are available only for SMS-managed datasets. Your installation will tell you whether SMS is active at your installation. When SMS is active, your installation can set various default for non-SMS-managed data sets.

For SMS-managed data sets, your installation will tell you the different storage, management, and data classes available and what option applies to each. A great deal of information must be supplied to read and write a data set, including the data set organization, record type, record length, and block length.

Supplying this information is one thing that makes JCL difficult. The information may come from three sources: the data control block (DCB) in the application, DD statement, and the data set label.

The syntax of the JCL DD statement.


//ddname DD DSNAME=data-set-name
            ,DISP=(status,normal-disp,abnormal-disp)
          [ ,UNIT=unit ]
          [ ,VOL=SER=serial-number ]
          [ ,SPACE=unit,(primary-qty,secondary-qty,dir) ]
          [ ,DCB=(option,option…) ]

DSNAME | Specifies the dataset name. 
DISP   | Specifies the dataset disposition (NEw, OLD, DEL, etc.) 
UNIT   | Specifies the group name, device type for new datasets.
SPACE  | Specifies the DASD space to be allocated for the file. 
DCB    | Specifies the parameter for the file’s data control block.

Examples of the DD statement.

A JCL DD statement to use an existing data set. 

//MSTFLE  DD   DSNAME=RC01.MSTFILE.MNTHLY,DISP=SHR

A JCL DD statement that creates a new data set and catalogs it 

//PAYMAST  DD  DSNAME=RC09.PAYROL.EMP.FILE,DISP=(NEW,CATLG),
//             UNIT=SYSDA,SPACE=(CYL,(10,10)),
//             DCB=(RECFM=FB,LRECL=110)

An SYSOUT DD SYSOUT=* statement is used to specify system output data-set, refer below an example of how to use dd sysout=* in JCL. 

//SYSOUT DD SYSOUT=*


What is the DUMMY Data Sets?


Dummy data-sets allow you to execute programs that process files without actually having the files present. When you use a dummy file, the system mimics performs all the file operations tasks with the DUMMY file. When a program tries to read a record from a dummy file, z/OS indicates an end-of-file condition, and when a program writes a record to a dummy file, the data is discarded.

DD DUMMY syntax in JCLs. 

//ddname DD DUMMY [,parameter]…


How to use SYSOUT DD DUMMY in JCL? 

In case, you have a requirement to suppress the processing of an SYSOUT data-set, then you must use the sysout dd dummy statement.  

SYSOUT DD DUMMY Syntax: 

   //ddname  DD  DUMMY,SYSOUT=class [Mention Class Name]

Thus, if you specify SYSOUT DD DUMMY statement, then system ignores the SYSOUT parameters and skip all output operation to the spool. 

SYSOUT DD DUMMY Example:

//INFFILE  DD  DUMMY,SYSOUT=A


How to override DD statement in JCL. 

To override DD name in JCL you need to follow below mention process i.e. PROC dd step-name.JCL DD name followed by other parameters. 

//pstepname.ddname DD     parameters

          

No comments:

Post a Comment

New In-feed ads