DD Statement IQ for Experienced
Explain the DD statement in JCL?
DD (Data Definition) statement is used to specify input and output files for a job step.
What is the role of the DD statement in JCL?
It defines a dataset or file name, attributes, and location and assigns it a DDname to be referenced within the job step.
Describe the DD statement syntax and keywords?
//DDname DD parameters [comments]
- DDname - It is the name assigned to the dataset or file being defined.
- DD Keyword - It is the keyword used to code the DD statement in JCL.
- Parameters - Parameters provide the additional information needed for DD statement.
- Comment - It is used to make a note of the current statement.
What is the meaning of data definition name (ddname) and dataset name (dsname) in the DD statement?
DDname is the name assigned to the dataset or file being defined. DSN (DataSet Name) parameter is used to specify the name of a dataset.
Is there any set of rules for DDname? Explain?
- The DDname should start from the 3rd column.
- DDname can be 1-8 characters.
- DDname is a combination of alphanumeric and special characters (@,#, and $).
What are different parameters for DD (Data Definition) statement?
DSNAME (DSN), DISP, SYSOUT, SPACE, UNIT, DSORG, RECFM, LRECL, BLKSIZE, DCB, VOLUME, LIKE, RECORG, DSNTYPE, DEST, EXPDT, KEYLEN, OUTLIM, RETPD.
What is the purpose of the position parameter in a DD statement?
Position parameters are mandatory to provide required information in the DD statement.
What is the first parameter in the DD statement of a JCL, and what information does it specify?
DSNAME and it provides the file name to JCL.
What is the Maximum number of DD statements in a step?
255
DSN Parameter -
What is a DSN parameter and why is it used in JCL?
DSN (DataSet Name) parameter is used to specify the name of a dataset.
What are the parameters to declare the DSN?
It provides the DataSet Name.
DISP Parameter -
What is use of DISP parameter in DD statement?
DISP parameter specifies how a dataset is to be handled in the job or job step.
How many parameters are there to a DISP statement and what are their uses?
DISP=(status[,normal-termination-action][,abnormal-termination-action])
What is DISP=(NEW,PASS,DELETE)?
It specifies that a new dataset is to be created, passed to further steps if step execution completed successfully or file deleted if step execution is not successful.
What does a disposition of (NEW,CATLG,DELETE) mean?
It specifies that a new dataset is to be created, cataloged if step execution completed successfully or file deleted if step execution is not successful.
What does a disposition of (NEW,CATLG,KEEP) mean?
It specifies that a new dataset is to be created, cataloged if step execution completed successfully or file kept if step execution is not successful.
How to access a file that had a disposition of KEEP?
It specifies that the dataset is to be retained on the volume. So we can access the file in a normal way.
What is the meaning of DISP=SHR?
It specifies the dataset already exists before the step and used only for reading.
What is the meaning of DISP=OLD?
It specifies that the dataset already exists and used with exclusive control on the dataset.
When should DISP=MOD is used?
It specifies dataset exists before this step and used to append the data to the dataset.
What does a disposition of (MOD,DELETE,DELETE) mean?
It specifies that append the data to the dataset, file deleted if step execution is not successful or unsuccessful.
The DISP in the JCL is MOD and the program opens the file in OUTPUT mode. What happens?
The data will be added to the end of the existing file without deleting or overwriting the current contents.
What do you do if you do not want to keep all the space allocated to a dataset?
We can use the RLSE subparameter with the SPACE parameter. This releases any unused space back to the system after the dataset is closed. For example -
SPACE=(CYL,(10,5),RLSE)
SYSOUT Parameter -
What is the significance of SYSOUT parameter?
It is used to specify the destination of system output, such as job log, operator messages, and program output.
SPACE Parameter -
What is use of SPACE parameter in DD statement?
It is used to specify the amount of disk space required for creating a new dataset and the allocation should request on direct access volume (DSAD).
How much space OS allocates when you create a PS or PDS?
OS allocates the space according to the values coded in the SPACE parameters by the user. This parameter defines the primary and secondary space allocations and the unit of allocation (e.g., cylinders, tracks, or blocks).
How much is memory space involved, when we code BLOCKSIZE, TRK & CYL?
- BLOCKSIZE: Specifies the size of data blocks in bytes. The total space depends on the block size and the number of records.
- TRK (Tracks): Specifies space allocation in tracks. One track typically holds 56,664 bytes on a 3390 disk.
- CYL (Cylinders): Specifies space allocation in cylinders. One cylinder usually consists of 15 tracks on a 3390 disk, totaling approximately 849,960 bytes.
UNIT Parameter -
What is the purpose of the unit parameter in the mainframe?
It is used to specify the system to place the dataset on a specific device or a group of devices.
DSORG Parameter -
What is the purpose of the DSORG parameter in the mainframe?
It specifies the organization of the dataset. The value of this parameter determines how the data in the dataset is arranged and accessed.
How does the system determine whether a file is a PS or a PDS file?
using DSORG parameter.
What are the valid DSORG values?
PS (sequential file), PO (PDS), DA (direct access).
RECFM Parameter -
What is the purpose of the RECFM parameter in DD statement?
What determines the record format in a data set?
It is used to define the record format for the new dataset. It specifies the structure of the records in the dataset, such as their length (fixed or variable) and storage structure (blocked or unblocked).
How many types of record formats are available?
15. U, UT, F, FB, FS, FT, FBS, FBT, V, VB, VS, VT, VBS, VBT and VBST.
LRECL Parameter -
What is the purpose of the LRECL parameter in DD statement?
What determines the record length in a data set?
It is used to specify the record length for new datasets during their creation.
BLKSIZE Parameter -
What is the purpose of the BLKSIZE parameter in DD statement?
It is used to specify the size of the physical blocks used when reading or writing a dataset.
How is a fixed block file created using the DD statement?
A fixed block (FB) file is created using the DD statement in JCL by specifying the RECFM=FB parameter and providing the LRECL (logical record length) and BLKSIZE (block size).
What is the max block size for a Tape file?
The maximum block size for a tape file in JCL is 32,760 bytes. This limit ensures compatibility and efficient processing across various tape devices and systems.
Min no of member’s (PDS) in one directory block?
The minimum number of members in one directory block of a PDS (Partitioned Data Set) is 6. This is because each directory block can hold information for up to 6 members.
DCB Parameter -
Explain in DD statement what is the use of DCB parameter?
It is a parameter that is used to define how a dataset is to be processed. The DCB parameter provides information about the organization, record format, record length, block size, and other dataset attributes.
How can you specify DCB information?
DCB=(subparameter[,subparameter]...)
What is the OS precedence for obtaining that DCB information, ie. where does the system look for it first?
- DD Statement Parameters: First, it looks at the DCB parameters specified in the DD statement of the JCL.
- Dataset Label: If not found in the DD statement, it checks the dataset label on the volume.
- Program Code: If still not found, it uses the DCB parameters defined in the COBOL or other program code.
VOLUME Parameter -
What is the purpose of the VOLUME parameter in DD statement?
It is used to specify the name of the DASD (Direct Access Storage Device) volume on which a dataset is stored or is to be stored.
LIKE Parameter -
What is the purpose of the LIKE parameter in DD statement?
LIKE parameter allows you to create a new dataset with the attributes of an existing dataset.
RECORG Parameter -
What is the purpose of the RECORG parameter in DD statement?
It is used to specify the record organization for the new dataset. It is only applicable while creating a VSAM dataset with SMS. RECORG is an optional parameter.
DSNTYPE Parameter -
What is the purpose of the DSNTYPE parameter in DD statement?
It is used to specify the dataset type with the DD statement. This parameter is always used while creating a dataset and tells the system that what kind of dataset it is.
DEST Parameter -
What is the purpose of the DEST parameter in DD statement?
It is used to specify the destination of printed output produced by a job. It identifies the physical printer or destination to which the output is to be sent.
EXPDT Parameter -
What is the purpose of the EXPDT parameter in DD statement?
It is used to set the expiration date while creating a new dataset. Once the expiration date is reached, the system automatically deletes the dataset without any user involvement.
KEYLEN Parameter -
What is the purpose of the KEYLEN parameter in DD statement?
It is used to specify the key length while creating the new dataset. If KEYLEN is not coded, the dataset does not have any keys.
OUTLIM Parameter -
What is the purpose of the OUTLIM parameter in DD statement?
It is used to set the maximum number of logical records that can be written to an SYSOUT dataset.
RETPD Parameter -
What is the purpose of the RETPD parameter in DD statement?
It specifies the number of days that a dataset should be retained from the date of creation.
Frequently Asked Questions -
What represents a data set name in a DD statement?
Explain DISP=(NEW,PASS,DELETE)?
What is the difference between specifying DISP=OLD and DISP=SHR for a dataset?
Mention what is the difference between specifying DISP=OLD, DISP=MOD and DISP=SHR for a dataset?
Mention what is the difference between specifying DISP=OLD, DISP=MOD and DISP=SHR for a dataset?
What is the role of the space parameter in the mainframe for data sets?
On the DD statement, what is the main difference between creating a new sequential flat file and a partitioned dataset?
What is use of DCB parameter in DD statement?
What are the keywords associated with DCB?
What does the keyword DCB mean and what are some of the keywords associated with it?