The Data Definition statements (DD statements) define where data is coming from or going to (source or output), also they define the LOADLIB in where the program can be found.
In case of DD statements, the name section is called filename or ddname.
The name section defines a short filename which will be used by the COBOL in SELECT statement ASSIGN TO clause as physical filename. The content of the name section is widely called DD name or ddname or filename; it is a pointer to the dataset.
Because a DD name is maximum 8 characters long, in case of many DD names, keeping up with the names can be tricky (TRANFILE, TRAFILE, TRAF, TRAFILEO, or in an extreme situation FILE0001, FILE0002, ...). The solution is to create a vocabulary matching DD names with verbal names. This vocabulary then can be inserted into the COBOL source code as a list of aliases in the ENVIRONMENT DIVISION. However, the file associations in the ENVIRONMENT DIVISION/INPUT-OUTPUT SECTION/FILE-CONTROL in the source code (SELECT ... ASSIGN TO ...) does the same, therefore definition of the aliases in the code needs considerations.
Parameters:
DSN (destination; the real data set)
DISP (disposition; dataset status, task after normal termination, task after abnormal termination)
DUMMY (the program receives an empty, non‑existent dataset; it has no value)
SPACE (TRK, CYL, BLKS, primary/secondary allocation, RLSE keys)
DCB (RECFM, LRECL, BLKSIZE, DSORG keys)
DATA
SUBSYS (e.g. SORT)
EXAMPLE FOR DD STATEMENTS:
The DSN parameter defines the dataset with its full-length qualifiers.
In case of PS, the DSN value simply contains the qualifiers, e.g. MY.PROJECT.INPUT.
In case of PDS, the DSN contains the qualifiers plus the member name in brackets, e.g. MY.PROJECT.CBL(READALL).
The VSCode can have syntax checking bugs. In case a DSN parameter value is shown as problematic, try to include it into single quote signs since the two formats are equal upon execution:
DSN=A.B.C(D)
DSN='A.B.C(D)'
In case of VSAM, the DSN value simply contains the qualifiers; it is common ground to mark the VSAM type in the last qualifier; e.g. MY.PROJECT.DATA.KSDS.
In case of GDG, in brackets, the relative version number is marked, e.g. MY.PROJECT.DATA(+1) means the new generation/version, MY.PROJECT.DATA(0) is for the actual, MY.PROJECT.DATA(-1) is for the previous generation/version.
EXAMPLE FOR DD FILES WITH DIFFERENT DATASETS:
The DISP parameter has these formulas:
DISP=status
DISP=(status,normal)
DISP=(status,normal,abnormal)
It always refers to the data set, not the addressed member of it (PDS, VSAM).
The status is obligatory:
SHR (shared access; the COBOL OPEN mode determines whether the dataset is opened for input or output)
OLD (exclusive access; the COBOL OPEN mode determines the actual read/write behavior)
MOD (appending if the dataset exists, creation of new if the dataset does not exist)
NEW (the program will create a new dataset)
The normal is optional, defines what should happen after the successful execution of the step:
KEEP (keeps, does not do anything with the dataset)
DELETE (deletes the dataset)
CATLG (catalogizes the dataset, it will be visible to other JCLs)
UNCATLG (deletes catalogization of the dataset but it physically remains, other JCLs can reach it by knowing volume data)
PASS (passes the dataset to another program within the same JCL)
The abnormal is optional, defines what happens upon an error:
KEEP (keeps, does not do anything with the dataset)
DELETE (deletes the dataset)
CATLG (catalogizes the dataset, it will be visible to other JCLs)
UNCATLG (deletes catalogization of the dataset but it physically remains, other JCLs can reach it by knowing volume data)
Using single and multiple DISP values:
DISP=SHR
DISP=(NEW,CATLG,DELETE)
DISP=(OLD,KEEP)
DISP=(MOD,KEEP,KEEP)
Separation of multiple DISP values:
DISP=(NEW,CATLG,DELETE) (preferred)
DISP=(NEW, CATLG, DELETE)
DISP=( NEW , CATLG , DELETE )
EXAMPLE FOR OPENING A FILE IN DIFFERENT STATUSES:
Physical attributes of a dataset.
RECFM (record format):
FB (fixed blocked)
FBA (Fixed Blocked + ANSI control char)
VB (Variable Blocked)
VBS (Variable Blocked Spanned)
U (Unformatted)
LRECL: Logical Record Length; must be in par with n field lenght in COBOL PIC X(n) type definition.
BLKSIZE: Block Size; physical block size of the dataset, important in optimalization, usually calculated by the system.
DSORG (Data Set Organization):
PS (sequential)
PO (directory, partitioned dataset)
VS (VSAM)
DA (direct access)
Concatenation means more datasets or members are read as one file by COBOL:
only the first dataset has ddname (this will be assigned in COBOL)
the following datasets has no ddname
the order of the datasets follows the order of the DD statements
only for PS and PDS; for sequential processes
In the background the JCL creates a DD chain which will be accessed as one continuous dataset. The data will not be copied to another (temporal) dataset.
EXAMPLE FOR DD CONCATENATION:
An in-stream data input means that the input will be defined within the job itself. The DD statement will contain * as its parameter. The value starts from the next line, and finishes when:
 the /* mark is reached
a statement is reached
the end of the JCL file is reached
In IBM dialect, there can be only 1 in-stream DD per program block, named always as SYSIN. In other dialects, it can be possible to name it otherwise. The SYSIN ddname marks the standard input, and it is often used along with in-stream data.
The in-stream data can be accessed from COBOL via using the ACCEPT instruction.
Because the in-stream data can have multiple lines, in COBOL it is possible to process it in a loop where the loop ends e.g. when a specific line is reached. In such case the ACCEPT will load an actual line from the JCL name like it would be a virtual sequential dataset with emulated end-of-file.
EXAMPLE FOR SYNTAX OF DD IN-STREAM DATA DEFINITION:
In JCL, there can be multiple in-stream DDs per program block. However, the IBM Enterprise COBOL can receive only one named SYSIN, therefore in the ACCEPT instruction the FROM <ddname> clause is unnecessary.
EXAMPLE FOR LOADING ONE-LINE IN-STREAM DATA:
EXAMPLE FOR LOADING MULTIPLE-LINE IN-STREAM DATA:
In the name section the SYSOUT marks the standard output. Usually used along with the SYSOUT parameter. This ddname can be user-defined as well, the parameter will determine the purpose of this DD statement.
The SYSOUT parameter is used as definiton of the standard output:
X (developer pool)
A (operator pool)
* (the output will be directed to the terminal or console; e.g. every DISPLAY in COBOL will show the output on the terminal screen)
EXAMPLE FOR SYSOUT DD STATEMENT:
The LOADLIB is a PDS which is used as a storage of compiled modules. Every module is a member. The JES will search for the program and its subroutines in the given LOADLIB.
The name section must be JOBLIB or STEPLIB.
The DSN parameter will define the LOADLIB PDS.
A LOADLIB can have any qualifier. Usually, these ending qualifiers are preferred:
MYID.LOAD
MYID.COBOL.LOADLIB
MYTEAM.LOADLIB
EXAMPLE FOR DEFINITION OF LOADLIB IN DD STATEMENT:
VSAM datasets are created differently, via the IDCAMS program in JCL. See the JCL PROGRAMS page.
In case the DIR (directory blocks) attribute appears, the database will be a PDS.
The GDG can contain only PS datasets, rarely PDS and PDSE datasets. It can not contains any VSAM datasets.
SPACE parameters:
DIR
TRK/CYL
primary/secondary
RLSE
BLKS/AVGREC
A TRK (track) and CYL (cylinder) are ancient definitions from when the background storage was made only from a large-capacity hard drive made of physical disks above each other. In virtualized and cloud worlds these expressions are meaningless, however, still used. If a server does not support a space type, the JCL and the ZOWE Explorer also will return with an error code upon creating a new dataset with it (e.g. the student mainframe server under the IBM ZXplore course uses virtualized small storage areas per student, the only allowed SPACE type is TRK). The Track is always smaller in space than the Cylinder therefore nowadays:
TRK is used for smaller data
CYL is used for large batch output, VSAM cluster, DB2 utility
DCB parameters:
RECFM (FB for fix, VB for variable record size, FBA, VBS, U for unformatted)
LRECL (record length)
BLKSIZE (blocksize)
DSORG (PS for Physical Sequential, PO for Partitioned Data Set, VS for VSAM, DA))
EXAMPLE FOR CREATION OF PS, PDS, GDG DATASETS: