Date Last Reviewed:
09/27/2007
JCL performs three basic functions:
JCL statements are easily identified by either a // or a /* in columns 1 and 2. If you don't see these when looking at a JCL statement, it is either a data statement, a program source statement, or an invalid JCL statement.
The following example demonstrates the JCL necessary to run a SAS program on MVS. The job's name is QUICK, and it belongs to Sam Sysprog who wants to have the output placed in bin 999.
//QUICK JOB , 'SAM SYSPROG',TIME=(0,5)
/*JOBPARM ROOM=0999
//STEP1 EXEC SAS
//SYSIN DD *
[SAS code]
/*
//jobname JOB
identifies your job to the system
/*JOBPARM
identifies options in effect for the job; include the ROOM= option to identify your bin.
//stepname EXEC
identifies a program or procedure you want to execute; all subsequent statements until the next EXEC statement form a job "step".
//ddname DD *
identifies all following statements until the next next /* statement as either a source program or data.
/*
identifies the end of a source program or the end of data.
//*
allows you to type comments in columns 4-71 to document your program.
//
no longer required but if present indicates the end of a job.
General form:
//jobname JOB ,'name',operands
where:
jobname
is a required name that must be from 1 to 8 alphanumeric characters in length with the first character being a letter.
name
is an optional 1- to 20-character field that will be printed on the banner of the job's output; enclose this field in single quotes (apostrophes) if it contains blanks or special characters.
operands
usually include only the TIME parameter. TIME gives the amount of time to allot for the job. The default is 5 seconds.
Example:
//SUREFIRE JOB ,'FARRAH FIRSTRUN',TIME=(0,10)
General form:
//stepname EXEC operands
where:
stepname
is an optional name that must be from 1 to 8 alphanumeric characters long and begin with a letter.
operands
describe the action you wish to occur in this step; you must include, as the first operand, either the PGM parameter or the name of a procedure you wish to execute. The REGION parameter is usually included as an operand when specifying a program (PGM=). The default region size is 512K.
Example:
For using a procedure://DOAPROC EXEC SASFor executing a program://USEAPGM EXEC PGM=IEBGENER,REGION=1024K
The JOBPARM statement is used to set options for your job. The general format of the JOBPARM is as follows:
/*JOBPARM options [start in column 11] where some of the possible options are as follows:
ROOM=nnnn [or] R=nnnn
This option specifies the bin you wish your output placed in. Bin numbers can be four-digit numbers.
LINES=nn [or] L=nn This option specifies the maximum number of lines (in thousands) your job may print. The default is 2,000 lines (LINES=2).
COPIES=n [or] N=n
This option specifies the number of copies of your output that you want. The current maximum is three, and the default is one (COPIES=1).
Example:
To print 2 copies of the output in landscape, oneup, simplex, with no flash, the code will be:
/*JOBPARM ROOM=0999,COPIES=2
The ROUTE statement specifies the destination of the output not routed by other means. If no ROUTE statement is included, the default is a printer in Swen Parson. The output will be placed in the bins in Swen Parson between the Operations window and room 130.
The ROUTE statement consists of a /* in columns 1 and 2, the word ROUTE in columns 3 to 7, a blank in column 8, the word PRINT in columns 9 to 13, and a blank in column 14. The destination is coded in columns 15 through 19 as needed. The possible choices of destination are:
Destination Location
LOCAL Swen Parson
RMT24 Stevens Annex
RMT15 MUC
RMT5 Computer Science Lab (CSL)
RMT7 UCL in Graham Hall
RMT14 HEEC
RMT4 Social Science Research Institute
Example:/*ROUTE PRINT RMT5
//jobname JOB
JOB statement is always first.
/*JOBPARM
JOBPARM statement is usually placed after the JOB statement.
COMMENTS may appear anywhere, except between continued statements, or in a source program or data.
//stepname EXEC
jobs may have multiple EXEC statements.
//ddname DD
steps may have multiple DD statements.
//
NULL statement if present is always the last in the job.
/*
Indicates the end of data or source listing.
There are several types of JCL messages that you may receive. All these messages are preceded by IEFnnnI, where nnn is an integer. Not all these messages are "bad" (i.e., an error message); some are informational. An example of an informational message is
IEF237I 682 ALLOCATED TO MYTAPE
This simply informs you that the device at 682 has been allocated to MYTAPE.
IEF210I ddn UNIT FIELD SPECIFIES INCORRECT DEVICE NAME
The UNIT field does not have a valid type (i.e., TAPE, DISK, etc.); also, the UNIT parameter may have been omitted.
IEF212I DATA SET NOT FOUND
The data set you have specified does not exist; make sure you have spelled its name correctly. If no VOL=SER= information was supplied, make sure you have cataloged it.
IEF253I DIRECT ACCESS - DUPLICATE NAME ON DIRECT ACCESS VOLUME
The data set you are attempting to create has the same name as one that already exists on the volume.
IEF257I DIRECT ACCESS - SPACE REQUESTED NOT AVAILABLE
You asked for more space for the data set you were creating or adding to than was available on the volume specified. Try another volume.
IEF605I UNIDENTIFIED OPERATION FIELD
The operation field on the JCL statement wasn't JOB, EXEC, or DD. The most likely cause is that you did not continue the previous line properly.
IEF606I MISPLACED DD STATEMENT
This means you have not preceded a DD statement with an EXEC statement. You may have left the EXEC statement out or made an error on the EXEC statement.
IEF611I OVERRIDDEN STEP NOT FOUND IN PROCEDURE
The spelling on the corresponding DD statement is probably incorrect.
IEF612I PROCEDURE NOT FOUND
The procedure you have specified on the EXEC statement does not exist; check the spelling of the procedure and make sure you didn't forget the PGM= parameter if you are executing a program rather than a procedure.
IEF621I EXPECTED CONTINUATION NOT RECEIVED
The previous statement indicated that it would be continued; however, the continuation was not made. Make sure you have not left any spaces after a comma, or that you have not left out the continuation statement, or that you have continued on or before column 16.
IEF622I UNBALANCED PARENTHESIS
You have probably omitted either a right or a left parenthesis on the corresponding JCL statement.
IEF630I UNIDENTIFIED KEYWORD
You have probably misspelled one of the keyword parameters on the flagged DD statement or misplaced an equal sign.
IEF640I EXCESSIVE NUMBER OF POSITIONAL PARAMETERS
A job control statement contained too many positional parameters. This may be caused by a misplaced comma, a duplication, or a null operand field.
IEF657I SYMBOL NOT USED IN PROCEDURE
A reference was made to a symbolic parameter on the EXEC statement that was not used in the procedure.
See The JOB Statement for the format of the JOB statement.
//jobname JOB statement
//stepname EXEC ASSIST
//SYSIN DD *
$JOB
[place program here]
$ENTRY
[place data here]
/*
//jobname JOB statement
//stepname EXEC IGYWCG
//COB.SYSIN DD *
[place program here]
//GO.SYSIN DD *
[place data here]
/*
//jobname JOB statement
//stepname EXEC SAS
//SYSIN DD *
[place program here]
/*
//jobname JOB statement
//stepname EXEC SPSS
//SYSIN DD *
[place program here]
/*
//jobname JOB statement
//stepname EXEC VSF2CG,LIBB='USER1.IMSL.V20.LOAD'
//FORT.SYSIN DD *
[place program here]
//GO.SYSIN DD *
[place data here]
/*