Data Definition Statement
Data Definition Statement Format
Data definition statements describe data sets and their input or output requirements. Every data set used in a job must have a data definition statement. The data definition statement is entered after the execute statement that identifies the job step in which that data set is used. (Data sets may be used in more than one job step and require a data definition statement for each job step.)
Format (A caret (^) indicates a space.):
//ddname^DD^dsname
The ddname is the name that you assign to the data set and must begin in column 3. Use the same format described in this module in the section titled Jobname.
The dsname is the name of the data set being defined by the data definition statement. Specify DSNAME= (or DSN=) followed by the name of the data set where the data is (or will be) located.
Example (A caret (^) indicates a space.):
//PAYROLL^DD^DSN=MONTHLY.PAYROLL.DATA
The ddname is PAYROLL.
The dsname is MONTHLY.PAYROLL.DATA.
Format (A caret (^) indicates a space.):
//stepname.ddname^DD^dsname
Programs such as FORTRAN, COBOL, etc. sometimes require a prefix for further identification. The ddname would then be preceded by the name of the qualifier, stepname, and a period.
Example (A caret (^) indicates a space.):
//STEP1.PAYROLL^DD^DSN=MONTHLY.PAYROLL.DATA
The ddname (with qualifier) is STEP1.PAYROLL.
The dsname is MONTHLY.PAYROLL.DATA.
SYSOUT Data Sets
A SYSOUT data set is a system output data set. The word SYSOUT is used instead of the word DSNAME.
Format (A caret (^) indicates a space.):
//ddname^DD^SYSOUT=dsn
The dsn is the name of the data set where you want the data to be placed. (Refer to the Printing module of the CIS User’s Manual.)
Format (A caret (^) indicates a space.):
//ddname^DD^SYSOUT=*
The asterisk specifies that the output be printed using default designations. The default destination is the impact printer in the CIS Machine Room. The default paper is the green barred, 14 7/8″ x 8 1/2″ continuous form.
Format (A caret (^) indicates a space.):
//ddname^DD^SYSOUT=a
Replace a with the message class parameter option that you want to use. (The message class parameter is defined in this module in the section titled Message Class Parameter.)
Format (A caret (^) indicates a space.):
//ddname^DD^SYSOUT=(a,,nnnn)
Output for a data set may be directed to the laser printer in the CIS Machine Room by specifying the output class and printer form number. For this data set only, these parameters override the parameters in the JCL job statement and JES2 job parameter statement.
Replace the parameter, nnnn, with the printer form number that you want to use. A list of form numbers (with specifications) is available at the Help Desk.
Replace the parameter, a, with one of the following output classes.
Output classes (for laser printing)
A and X Duplex DrilledC Simplex DrilledD Duplex Non DrilledE Simplex Non DrilledF Duplex OtherG Simplex Other
Duplex prints on both sides of the paper.
Simplex prints on the front side of the paper.
Drilled punches three holes on the left side (portrait) or top (landscape) of the paper.
Non drilled indicates that no holes will be punched.
Other indicates that special handling is being requested. A JES2 message statement must be used to inform the operator how to handle the output.
SYSIN Data Sets
Sysin data sets provide input data to the job. The word, SYSIN, is used for the ddname.
Format (A caret (^) indicates a space.):
//SYSIN^DD^dsname
The dsname parameter provides the name of the data set in which the data is located.
Example (A caret (^) indicates a space.):
//SYSIN^DD^DSN=MONTHLY.PAYROLL.DATA
The input data is in data set MONTHLY.PAYROLL.DATA.
Format (A caret (^) indicates a space.):
//SYSIN^DD^DATA
or
//SYSIN^DD^*
These statements indicate that the data is in an in-stream data set that immediately follows the sysin data definition statement. The asterisk in the statement indicates that no JCL or JES2 statements are included in the data. Therefore, none of the data records can begin with //, /*, or //*.
Disk and Tape Data Sets
Data sets that are stored on-line (on disk) or off-line (on tape) have the same basic format.
Format (A caret (^) indicates a space.):
//ddname^DD^dsname,param1,param2
Parameters used to define a data set are represented here by param1 and param2. (Additional information is available in this module in the section titled Data Definition Statement Parameters.)
If a data set is created in a job, passed to another job step, and deleted within the same job, then the dsname should begin with two ampersands, & & .
Example (A caret (^) indicates a space.):
//WORKFILE^DD^DSN=& & TEMP
Data Definition Statement Parameters
Parameters are used to describe the physical characteristics of a data set. These vary depending on whether the data set is input, output, etc. Interim parameters are followed by a single comma (and no spaces). The final parameter must not be followed by a comma. Some of the more commonly used parameters are described in this section. For additional information about these and other parameters, refer to the IBM Manual, JCL Reference.
Volume Parameter
The volume parameter is used to indicate a specific tape or disk on which the data set resides. Cataloged data sets do not require this parameter. Uncataloged data sets require this parameter. A new data set does not require this parameter and it will be assigned a volume serial number that will be displayed with the job messages.
Format:
VOL=SER=aaaaaa
Replace aaaaaa with the volume serial number assigned to the data set.
Disposition Parameter
The disposition parameter describes the status of a data set and the processing of the data set at normal and abnormal termination. This parameter may have up to three positional subparameters. If more that one subparameter is used, they must be separated by commas and enclosed in parentheses.
Examples:
DISP=SHR
DISP=(NEW,PASS)
DISP=(OLD,DELETE,KEEP)
First Positional Disposition Subparameter
This subparameter identifies the status of the data set before the job is executed.
NEW (default) The data set is created in this job step.OLD The data set previously existed and this job step requires its exclusive use.SHR (share) The data set previously existed and can be used by more than one job at the same time.MOD (modify) A new data set is to be created or a sequential data set exists and records are to be added to its end. This job step has exclusive use of the data set.
Second Positional Disposition Subparameter
This subparameter instructs the operating system what to do with the data set if the job step ends normally.
DELETE (default) The data set is deleted in this job step.KEEP The data set is kept intact.PASS The data set is kept for use by a later job step. (The last job step that uses the data set will determine its final disposition.)CATLG The data set is kept and a catalog entry is created or updated for it.UNCATLG The data set is kept and its catalog entry is removed.
Third Positional Disposition Subparameter
This subparameter instructs the operating system what to do with the data set if the job step ends abnormally.
DELETE The data set is deleted in this job step.KEEP The data set is kept intact.CATLG The data set is kept and a catalog entry is created or updated for it.UNCATLG The data set is kept and its catalog entry is removed.
Unit Parameter
The unit parameter is used to specify the tape or disk device on which the data set resides. Cataloged data sets do not require this parameter. Uncataloged and new data sets require this parameter.
Format:
UNIT=aaaaaa
Replace aaaaaa with one of the following:
TAPE Any available reel tapeTAPEC Cartridge tape (for new or old data sets)TAPECC Cartridge tape (for new data sets)SYSDA Any available SYStem Direct Access device (SYSDA is the generic name for any of the DASD (Direct Access Storage Device) disk volumes.
Space Parameter
The space parameter is used to allocate space for new data sets. There are charts available to aid in the determination of the amount of space needed for a data set. If you need assistance, you may consult the Help Desk. (The 3380 device currently in use has 47,476 bytes per track and 712,140 bytes per cylinder.)
Format:
SPACE=(aaa,(p,s))
Replace aaa with CYL (cylinders), TRK (tracks), or a block length (if the data set is small).
Replace p with the amount of primary allocation space that you need for your data set.
Replace s with the amount of secondary allocation space that you want to be allocated to your data set if the primary allocation becomes insufficient. (No more than fifteen secondary allocations will be made.)
Example:
SPACE=(CYL,(10,2))
Ten cylinders of space will initially be allocated to this data set. Additional space will be allocated, as needed, two cylinders at a time. The maximum amount of space that can be allocated to this data set is 40 cylinders (10 + (15 X 2)).
Example:
SPACE=(800,(500,100))
The units, 800, represents a block size of 800 bytes.
Five hundred blocks (400,000 bytes) will initially be allocated to this data set. Additional space will be allocated, as needed, one hundred blocks (80,000 bytes) at a time. The maximum amount of space that can be allocated to this data set is 2,000 blocks (500 + (15 X 100)).
Data Control Block Parameter
The data control block parameter is used to define a new data set. The subparameters are keyword parameters so they may be in any order. (Additional information is available in this module in the section titled Keyword Parameters.)
Format:
DCB=(LRECL=nnn,BLKSIZE=nnnnn,RECFM=aaa)
Replace aaa with one of the following record format (RECFM) subparameters:
F Fixed length, unblockedFB Fixed length, blockedV Variable length, unblockedVB Variable length, blockedVBS Variable length, blocked, spannedU Undefined
Replace nnn with the length of the longest record in the data set. This is the record length subparameter (LRECL).
Replace nnnnn with the length of each block in the data set. This is the block size subparameter (BLKSIZE). For fixed format, the block size is some multiple of the record length. (Additional bytes have to be added to the record length multiple when variable format is used.) Optimal block sizes may be determined by referring to tables for the unit on which the data set will reside or by using the Blocksize Command.
Blocksize Command
A programming aid is available on TSO that will help you to determine the block size. At the TSO READY> prompt, type the following command:
BLKSIZ
You will be prompted for the following:
1. RECFM (F or V)2. (Fixed) LRECL =2. (Variable) MODAL LRECL(INCLUDING RDW) =3. Number of records =
Suggested allocation characteristics will be displayed in the form of:
1. an ISPF 3.2 screen,2. a JCL space parameter, and3. a TSO Allocate command.
(Information about TSO and ISPF may be found in the CIS User’s Manual module, TSO Introduction.)
You still must make some decisions. If you are creating a partitioned data set, you must specify the number of directory blocks. If you wish to allow for expansion, you need to specify a secondary space quantity. (Additional information is available in this module in the section titled Space Parameter.)
Data Definition Statement Examples
Example (A caret (^) indicates a space.):
//GO.SYSIN^^^^DD^DSN=U19999A.PROGRAM.DATA,DISP=SHR
This data definition statement informs the operating system that the SYSIN input data is located on a disk in a cataloged data set named U19999A.PROGRAM.DATA and that the data set may be accessed by other jobs. (The disposition parameter is the only parameter required for a cataloged, pre-allocated data set .)
The qualifier GO. preceding the ddname SYSIN indicates that this data definition statement is used in a job step with the stepname GO.
Example (A caret (^) indicates a space.):
//OUTPUT^^^DD^SYSOUT=(A,,9021)
This data definition statement specifies that the data defined by the name OUTPUT be directed to the laser printer in the CIS Machine Room.
The data will be printed on form 9021 (8 1/2″ x 11″, landscape, 132 characters per line, gray bar paper).
Class A specifies that the data be printed on both sides of the paper and that three holes be punched at the top of the front of the page.
Example (A caret (^) indicates a space.):
//NEWDATA^^DD^DSN=U99999A.NEWDATA.CNTL,UNIT=SYSDA,
// DISP=(NEW,CATLG),SPACE=(TRK,(5,5)),
// DCB=(LRECL=80,BLKSIZE=9040,RECFM=FB)
The data definition statement name is NEWDATA.
The data set name is U99999A.NEWDATA.CNTL.
The disposition parameter instructs the operating system to create a new data set and to catalog it.
The unit parameter specifies that the data set be located on one of the system disks.
The space parameter specifies that five initial tracks of disk space be allocated with increments of five tracks added as needed.
The data control block parameter specifies that the record length of the data is 80 bytes, the blocksize is 9040 (113 records), and that the format of the data is fixed, blocked.
Example (A caret (^) indicates a space.):
//SYSUT2^^^DD^DSN=U99999A.OLDDATA.CNTL,UNIT=TAPEC,
// DISP=(OLD,KEEP),VOL=SER=C12345,LABEL=5
The data definition statement name is SYSUT2. This ddname is one that is sometimes required by IBM utility programs such as IEBGENER.
The data set name is U99999A.OLDDATA.CNTL.
The disposition parameter instructs the operating system that this data set already exists and that it is to be kept at the end of this job step.
The unit parameter indicates that the data set is located on a cartridge tape.
The volume parameter indicates that the volume serial number of the tape is C12345.
The label parameter indicates that the data set is the fifth data set on the tape.