JOB CONTROL LANGUAGE


Purpose
Introduction to JCL
The JOB Statement
The EXEC Statement
The DD Statement
Miscellaneous JCL Statements
Related Documentation
Glossary

Purpose

The purpose of this discussion is to acquaint users with the Job Control Language (JCL) required to run jobs on the USC computer system.  Though not a comprehensive discussion, this document covers the most commonly used JCL, and will enable most users to code the JCL required by their jobs.  Users who need to perform more complicated operations should consult Related Documentation.  Questions about the content of this discussion should be referred to a consultant at 777-6865.

For an explanation of any unfamiliar terms used in this discussion of JCL, please refer to the glossary at this conclusion of this document.

Introduction

JCL consists of statements that direct the computer system in the handling of programs submitted for processing.  JCL specifies work to be done, methods to be used, and resources to be allocated (including input and output requirements).



The Function of JCL

Four distinct functional areas of JCL are:

 1. Introducing new jobs to the system, providing information for checking user authorization, defining characteristics of resources to be used (JOB statement)
 2. Indicating which compilers, programs, or cataloged procedures are to be used (EXEC statement)
 3. Describing the location and characteristics of files being input to and output from the job (DD statement)
 4. Indicating miscellaneous processing requirements

For example, in order for the operating system to execute a user-written FORTRAN program, a job must be submitted consisting of the user's program and JCL statements he has written to direct the execution of his job.  Through a JOB statement the user identifies himself to the operating system as an authorized user, and he sets time, memory, and other physical resource requirements for the program; through the EXEC statement he calls a FORTRAN cataloged procedure to interpret his program (instead of a COBOL or SAS cataloged procedure which couldn't interrupt the FORTRAN code); through DD statements he describes the location and physical characteristics of any data sets to be read from and written to by his program.



The Format of JCL

A typical JCL statement consists of slashes (//) in columns one and two followed by four fields: name, operation, operands, and comments.

All letters in JCL statements must be upper case letters.  Lower case letters in statement formats illustrated in this document should be replaced with user-supplied values (in upper case).

A JCL statement takes the following form:


     //name operation operands comments
name - this field identifies a JCL statement, giving it a name, and thus allowing other statements to refer to it.  The name in this field consists of 1-8 alphanumeric (A-Z, 0-9) or national (@, #, $) characters.  The first character must be alphabetic or national.  The name field begins in column 3 and is followed by one or more blanks to separate it from the operation field.
operation - this field specifies the type of the JCL statement (JOB, EXEC, DD).  It is preceded and followed by one or more blanks.
operands - this field contains parameters that may be assigned different values according to job requirements.  Parameters in this field must be separated by commas and must not contain intervening blanks.  The operand field must be preceded by one or more blanks.
comments - this field is used to document the JCL and can contain any information.  It must be preceded by one or more blanks.

With the exception of the JCL comment statement (see Miscellaneous JCL Statements for a description), no JCL statements may extend beyond column 71.  Statements can be continued on subsequent lines by performing each of the following steps in turn:

   1. Interrupt the statement after a comma (that is, at the end of a parameter) before column 72,
   2. Place slashes in the first two columns of the second line,
   3. Skip at least one space after the slashes,
   4. Continue with the statement at any position before column 16.

For example, the following two lines of JCL represent one JOB statement that has been continued on a second line:


   //PROG JOB (N1234567,2,,2),'JOHN DOE',
   // USER=N123456,PASSWORD=DOE

The JOB Statement

The JOB statement is the first statement of any job.  It identifies the job and the user.  There should be only one JOB statement coded for each batch job.



Format of the JOB Statement

The format of the JOB statement follows with an explanation of each field in the statement.  Please note that following the accounting field (in parentheses), commas are required to separate fields on the JOB statement.


     //jobname JOB (account#,lines,cards,forms,copies,linecnt),
     // 'programmer name',USER=userid,PASSWORD=password
// - Two slashes must appear in the first two columns of the JOB statement (and in any continuation lines of the JOB statement).  These slashes are positional (that is, they must be in this position, columns 1 and 2), and they are REQUIRED.
jobname - a 1-8 character name supplied by the user, begins in column three.  The first character of the jobname must be alphabetic (A-Z) or national (@, $, #).  The jobname is positional and is REQUIRED.
JOB - is a keyword required by the system. It must be preceded and followed by at least one blank. The keyword JOB is positional and REQUIRED.
(account#,lines,cards, forms, copies, linecnt) - this field in the JOB statement describes Accounting parameters, and must be enclosed between parentheses, parameters separated by commas.  No blanks should be coded anywhere in the accounting parameters field. Of these accounting parameters, only the account# parameter is required.
   account# - represents an eight-character account number assigned by Computer Services.  The account number is positional and REQUIRED.
   lines - represents the estimated number of lines, in thousands, to be printed by the job.  It must be a one- or two-digit integer (30 would request 30,000 lines).  The system default is 1,000 lines.  The maximum number of lines that may be printed is 99,000. The job will "abend" (end abnormally) if it attempts to output more than the specified or default number of lines.  The 'lines' information is optional but, if specified, is positional.
   cards - represents an integer that specifies, in tens, the estimated number of card images to be punched by the job.  It may be 1-4 digits long and defaults to zero.  The maximum number that may be punched is 25,000.  The job will abend if it attempts to output more than the specified number of card images.  The 'cards' information is optional but, if specified, is positional.
   forms - represents the four-digit number of the special form to be used by the job.  Anyone needing to use forms other than the standard output paper (which is the default) should refer to the FORMS handout. The 'forms' information is optional but, if specified, is positional.
   copies - represents the number of times the output from a job is to be printed or punched.  It may be up to two digits long.  The default value is 1 (for one copy).  The maximum number of copies that may be printed is 50.  The 'copies' information is optional but, if specified, is positional.
   linecnt - specifies the number of lines to be printed per page. The default is a full page (sixty lines).  The 'linecnt' information is optional but, if specified, is positional.

Since all of the parameters in the 'accounting parameters' field except the account number are optional, it is possible to code some of the parameters and take the default for others.  To take the default for a parameter, code a comma (only) in the position of that parameter in the field.  The comma is needed because the parameters are positional; there must be something, a digit or a comma, in the position to indicate to the system which parameter is being coded.  For example, to code a parameter requesting two copies of the output from a job, you would use the following accounting parameters' field:

     (N1234567,,,,2) 
Code one comma following the account number, a second comma to take the default for 'lines', a third for 'cards', and a fourth for 'forms'.  Notice that it is not necessary to code a comma for the 'linecnt' field since it comes at the end of the field and there is no ambiguity about which parameter is being coded.

Optional accounting parameters can be coded more easily using the JOBPARM statement discussed in Miscellaneous JCL Statements.

programmer name - this field represents, in most cases, the name of the individual submitting the job, but it may contain any identifying information.  It may be 1-20 characters long and must be enclosed in single quotes if it contains blanks or special symbols.  The programmer name is positional and REQUIRED.
USER=userid - this field identifies the user to the Resource Access Control Facility (RACF), which controls access to system devices and data sets.  The 'userid' consists of 1-8 alphanumeric or national characters; the first character must be alphabetic or national.  The 'userid' is assigned by CS.  The USER parameter is REQUIRED but is not positional.
PASSWORD=password - this field specifies the user-defined password associated with the account# and userid used on the job statement.  The combination of these parameters verifies a user's authorization to system resources.  Passwords consist of 5-8 alphanumeric or national characters.  The first character must be a letter or national character.  The PASSWORD parameter is REQUIRED but is not positional.  NOTE: A password automatically expires sixty days from the date it was last changed.  For information on changing passwords, refer to the handout PASSWORD .



Optional JOB Statement Parameters

The following JOB Statement parameters are optional; if specified on the JOB statement, they are not positional.

TIME=(mm,ss) - this specifies the maximum amount of CPU time to be allowed for a job:
   mm represents minutes
   ss represents seconds

If only minutes are to be used, code:

TIME=mm
If only seconds are to be used, code:
TIME=(,ss)
If one minute is required, code:
TIME=(1,0)
NOT
TIME=(,60)
If the TIME parameter is omitted, the job time will default to 10 seconds.  The TIME parameter is optional and, if specified, is not positional.
REGION=nnnK - specifies the amount of main computer storage to be allocated for the job.    nnn represents an integer specifying the number of bytes of storage, in thousands, to be allocated for the job (for example, 256K).  If the REGION parameter is not coded, the default REGION specified in the procedure executed is taken.
NOTE: The REGION parameter on the JOB statement can be overridden in individual steps in a job by specifying a REGION parameter on the EXEC statement -- see the EXEC Statement for details.) The REGION parameter is optional and is not positional.
NOTE: Jobs requiring certain combinations of TIME and REGION may require special scheduling by CS.  For information on which jobs require scheduling, consult the JOBS documentation. MSGCLASS=x - specifies the output class to which output from the job is to be written.  MSGCLASS=A indicates output is to be written to a line printer or CMS virtual reader;
 MSGCLASS=B indicates that output is to be written to a card punch or CMS virtual reader.
The MSGCLASS= parameter coded on the JOB statement may be overridden for an individual data set with the SYSOUT parameter on the DD statement (see the discussion of the SYSOUT parameter in DD Statement).  MSGCLASS=A is the default for jobs submitted through a through CMS.  The MSGCLASS parameter is optional and, if specified, is not positional.
NOTE: Most RJE sites no longer maintain a card punch.  Before coding MSGCLASS=B, make sure that the remote to which you intend to route the output has a card punch.
MSGLEVEL=(y,z) - indicates which JCL statements ('y') and allocation/termination messages ('z') are to be written as output for your job.

One of the following should be supplied as the value of y:
  0 - prints only JOB statements
  1 - prints all JCL statements including expansion of PROCs.
  2 - prints only Job Control Language input by the user

One of the following should be supplied as the value of z:
  0 - prints no allocation/termination messages
  1 - prints all allocation/termination messages

The default is:

MSGLEVEL=(2,0)
The MSGLEVEL parameter is optional and, if specified, is not positional.

While the MSGLEVEL parameter is optional, MSGLEVEL=(1,1)should be coded for most job runs.  If MSGLEVEL=(1,1) has not been coded on a job, and the job abends, there may not be enough information printed to determine the cause of the abend.

TYPRUN=COPY - specifies that no processing is to take place and that the input file is to be printed immediately as it is.
TYPRUN=SCAN - specifies that the JCL for the job is to be scanned for syntax errors, but the job is not to be executed.
TYPRUN=COPY, and TYPRUN=SCAN are optional and, if specified, are not positional.

A ROUTE statement normally follows the JOB statement, directing job output to a specific destination.  For more information on the ROUTE statement, see Miscellaneous JCL Statements.

The EXEC Statement

The principal function of the EXEC (execute) statement is to identify the cataloged procedure to be called or the program to be executed.  A cataloged procedure is a group of JCL statements that are stored in the system procedure library.  CS maintains a large number of cataloged procedures in this library to provide the necessary JCL for a variety of commonly used applications, such as invoking compilers, utilities, statistical packages, and other programs.



Executing a Catalogued Procedure

The format of an EXEC statement that uses a cataloged procedure is:

   //stepname EXEC PROC=procname,parameters 
or
   //stepname EXEC procname,parameters 
For example:
   //STEP1 EXEC PROC=SCRIPT 
or
   //STEP1 EXEC SCRIPT 


Format of the EXEC Statement

The fields of the EXEC statement are:
// - slashes in the first two columns identify the statement as a JCL statement.
stepname - follows the slashes (beginning in column three) and provides a name for referencing the step.  A stepname must be 1-8 characters long; the first character must be alphabetic.  Though stepnames are not required except when the step is to be referenced by later steps, they are useful for tracing errors in multi-step jobs.
EXEC - this keyword must be preceded and followed by at least one blank.
PROC=procname - this optional parameter specifies that a cataloged procedure is to be used.
  procname represents the name of the procedure to be executed by the program.
NOTE: 'procname' alone may be used to indicate the procedure to execute -- see the example above.
PGM=pgmname - this keyword parameter should be used only if a program is to be executed directly from a PDS without using a cataloged procedure.
  pgmname represents the name of the load module program to be executed by the job.
parameters - various optional parameters can be coded on the EXEC statement (after a comma following the procname or pgmname) to specify the amount of main memory or the maximum time allowed for the step, to pass parameter values to the step, and to set conditions that must be satisfied for the procedure or program in the EXEC statement to be executed.
  REGION=nnnK - may be used ('nnn' represents an integer) to indicate, in thousands of bytes, the amount of main memory needed for the job step.  Many cataloged procedures include a main memory specification.  By coding a REGION parameter on the EXEC statement that invokes the procedure you can override the main memory specification in the cataloged procedure.
  TIME=(mm,ss) - specifies the maximum amount of time that can be used by the step (mm represents minutes, ss seconds).
  COND=(code,operator,stepname) - can be used to bypass job steps based on the outcome of previous steps:
    code represents an integer return code;
    operator represents a comparison operator such as GT (greater than) or EQ (equals);
    stepname is the name of the preceding step that issued the return code (for example, COND=(4,LT,STEP1) or COND=(4,LT) ).
  PARM='options' specifies information or compiler options that the system is to pass to the processing program (may be up to 100 characters).
    'options' (single quotes required) represents the information or options to be passed.  Consult the reference manual for the particular language you are using for information on specific options available for that language.

The following example of an EXEC statement specifies 'STEP1' as the stepname of the step, executes the cataloged procedure 'SCRIPT', overrides the main memory specification in the cataloged procedure (setting the REGION for the step at 256K), and sets the maximum time for the step at 10 seconds:

   //STEP1 EXEC SCRIPT,REGION=256K,TIME=(,10) 

The DD Statement

The DD (data definition) statement provides the computer with information regarding the form and location (tape, disk, printer, etc.) of the input and output data sets to be used or referenced by the system.  Each input and output file must be described by a DD statement.



Format of the DD Statement


Following is an example of the general format of the DD statement with an explanation of each field:

     //ddname DD operands comments 
// - slashes must appear in the first two columns to identify the statement as a JCL statement.
ddname - is the user-defined name used by a processing program to refer to the data set defined by the DD statement.  A ddname must consist of 1-8 alphanumeric or national characters and must begin with a letter or a national character.  The ddname in the JCL must match the filename in the processing program that refers to the data set.  NOTE: a ddname is REQUIRED except when concatenating data sets (see the following subhead describing the procedure for concatenating data sets).

Following is a list of frequently used programming languages and ddname conventions:

  COBOL - The ddname is the filename from the ASSIGN clause.
  PL/I - The ddname is the filename in the OPEN, DECLARE, or READ/WRITE statement that declares the file.
  FORTRAN - The ddname has the form FTnnF001, where 'nn' represents the unit number in the READ or WRITE statement accessing the file.
  SAS - The ddname is the filename on the DATA, INFILE, SET, MERGE, UPDATE, or other, similar statements.
  SPSS-X - The ddname is specified in the FILE parameter of the DATA LIST and SAVE commands.

DD - this keyword identifies the JCL statement as a DD statement and must be preceded and followed by at least one blank.
operands - this field contains positional and/or keyword parameters describing files to be processed.  There are three optional, positional parameters (that is, if they are used, they must follow the DD keyword and come before any of the other parameters):
* - an asterisk may be coded to indicate that data will follow immediately after the DD statement.   The format of such a statement is

        //ddname DD * 
The end of the data in the job stream is indicated by coding /* or // in columns one and two ('//' alone marks the end of the job).  The data following the DD * should not contain // or /* in the first two columns of a line.  An example of the typical use of this parameter is the statement:
       //SYSIN DD * 
DATA - this alternate keyword is used, like the * parameter, to indicate that data will follow immediately after the DD statement.  The format of a DD statement employing the keyword DATA is:
        //ddname DD DATA,DLM='xx' 
xx represents any two characters that, when encountered in columns one and two in the job stream, will signal the end of the data (do not choose characters for 'xx' that appear in the first two columns of a line of data).  The DATA parameter is different from the * parameter in that the data may contain // or /* in the first two columns as long as a delimiter has been specified.

DUMMY - this keyword may be used to indicate that no input/output devices are to be assigned to the file and that no input/output (I/O) operations are to be performed.  This keyword is used in situations requiring that a file be described in a DD statement, but in which the file is not actually used in the program.  The format for such a DD statement employing DUMMY is:

        //ddname DD DUMMY

The following optional DD parameters are not positional.  If multiple optional parameters are coded, they should be separated by commas.  These other optional parameters are:
SYSOUT=(y,zzzz),COPIES=nn,DEST=N1Rxx 
SYSOUT - keyword that assigns an output class to an output data set, and may be used to request multiple copies of the output data set, and to route the data set to a specific destination.
  y - this value assigns an output class to the data set, and should be either 'A' to direct the data set to a line printer or CMS virtual reader, or 'B' to direct output to a CMS virtual reader.
  zzzz - represents a special forms number.  If omitted, regular paper will be used.
NOTE: an asterisk (SYSOUT=*) may be coded instead of supplying values for '(y,zzzz)' to indicate that the same output device as specified in the MSGCLASS parameter on the JOB statement is to be used.
COPIES=nn - this operand is optional.  It may be used to request multiple copies of the output data set.
  nn indicates the number of copies of the data set to be produced.  NOTE: If copies are specified on both the JOB statement and on the SYSOUT DD statement, the two values will be multiplied to determine how many copies to print.  For example, if 5 copies are requested on the JOB statement and 10 copies are requested on the SYSOUT DD statement, 50 copies will be produced.
DEST=N1Rxx - this operand is optional.  It may be used to route an output data set to a specific destination.
  xx is replaced by a number representing a remote printer, for example, N1R0 represents the CS LOCAL printer.

See the OUTPUT statement in Miscellaneous JCL Statements for more information concerning routing individual SYSOUT data sets to CMS.

DSNAME (or DSN) - specifies the name of a data set to be accessed.  A data set name (DSNAME or DSN) may consist of several qualifiers separated by a period.  No qualifier may exceed 8 characters; each must begin with an alphabetic or national character.  The total length of qualifiers, including periods, may not exceed 44 characters.  If the name is preceded by &&, the data set will automatically be deleted at the end of the job (temporary data set).  If the data set is to be cataloged on disk or tape, it must begin with a valid RACF userid.

Examples:


         DSN=&&DATA
         DSN=A123456.TAP.DATA
         DSN=A123456.DSK.DATA, 

If a particular member of a PDS is being referenced, the DSN includes the member name in parentheses at the end of the data set name.

         DSN=N123456.DATA(GROUP1) 
In this example, the name of the data set is N123456.DATA, and the name of the member is GROUP1.

DISP=(status,disposition,conditional-disposition) - specifies the status of the data set accessed (to be created, old, etc.), how it is to be handled at the end of the step, and how it is to be handled if the step abends.
  status - defines the status of the data set at the beginning of the current step and may have as its value any of the following:
   NEW - creates a data set
   OLD - indicates that the data set already exists and causes the program to assume exclusive control of the data set.
   SHR - enables an existing data set to be used by different programs being run at the same time.
   MOD - adds new data onto the end of an existing data set.  If the data set does not exist, MOD has the same effect as NEW.
  disposition - sets the status for the data set at the end of the job step if the step ends normally and may be any of the following:
   KEEP - the data set will be saved after the job is terminated.
   DELETE - the data set is to be purged after the job is terminated
   CATLG - places the DSNAME and other information about the data set in the system catalog (implies KEEP).
   UNCATLG - removes DSNAME and other information about the data set from the system catalog (implies KEEP).
   PASS - pass the data set for use by a subsequent step in the same job.
conditional-disposition - specifies the action to be taken if the job abends (ends abnormally).  This parameter may be replaced with KEEP, DELETE, CATLG, UNCATLG (described above).  PASS may not be used.  If no DISP parameter is coded, the system supplies default values.  If 'status' is omitted, 'NEW' is assumed.  If 'disposition' and 'conditional-disposition' are omitted, the system supplies values according to the status of the data set:

* If the data set existed before the job, KEEP is supplied
* If the data set was created in the job, DELETE is supplied

If 'conditional-disposition' is omitted and 'disposition' is supplied, then whatever was specified for 'disposition' will be used for 'conditional-disposition.'

Example of the DISP parameter:

         DISP=(OLD,CATLG,DELETE) 
This example of the DISP parameter specifies that the data set existed before the step, that after the step the data set is to be cataloged, and that if the step abends, the data set is to be deleted.

UNIT=devicetype - specifies the type of device to which data is to be output or from which data is to be input.  'devicetype' may be one of the following:
  SYSDA - this value should be coded for all temporary data sets. Temporary data sets are those kept only for the duration of the job.
  TAPE9 - this value is used for all 9-track, 1600 bpi tapes.
  TAPED - this value is used for all 9-track, 800 bpi tapes.
  T6250 - this value is used for all 9-track, 6250 bpi tapes.
  CTAPE - this value is used for all 3480 tape cartridges (square tapes).
  DASD - this value is used for all 3390 disk storage data sets.

Users who are testing jobs that use tape I/O should investigate the use of the DEFER parameter, which prevents mounting a tape until it is actually called for.  See the Related Documentation for details on using DEFER.

SPACE=(space-unit,(primary,secondary,directory block),RLSE) - indicates the amount of disk space required.  NOTE: for information on calculating SPACE allocations for 3390 disk storage data sets, enter the command DISKSTOR from CMS.  The SPACE parameter should be coded as follows:

  space-unit - represents the unit in which the space will be allocated.  It may be any one of the following:
     TRK - specifies that space is to be allocated by tracks.  1 track on 3390 disk storage equals 56,664 bytes.
    blocksize - is an integer that indicates the blocksize of the data.
  primary - represents the number of tracks, or blocks to be allocated to the data set initially.
  secondary - represents the number of tracks or blocks to allocate if the primary allocation is exceeded.  Up to 15 secondary allocations can be made.  For example:

     SPACE=(TRK,(20,5),RLSE) 
results in a primary allocation of 20 tracks and up to 15 extents of 5 tracks maximum each.  The maximum space that could be allocated is: 20 + 5(15) = 95 tracks.
  directory block - this option is to be coded only when a partitioned data set (PDS) is being created.  It should be a number that specifies how many 256-byte blocks are to be contained in the directory of a PDS.  Approximately six members' directory listings can fit into one 256-byte block.  Therefore, the number of directory blocks can be approximated by dividing the number of possible members by six.  Note: When allocating primary space, allow space for the directory blocks allocated;  1 track on 3390 disk storage will hold 48 directory blocks.
  RLSE - specifies that any unused space is to be released when the job step is finished with the data set. This parameter is optional; it should be coded for sequential data sets only.
Example of coding the SPACE parameter:
            SPACE=(TRK,(10,1),RLSE) 
Specifies that ten tracks of space are to be allocated initially, that tracks are to be added to this allocation by ones if needed, and that unused space is to be released for other uses.

DCB=(LRECL=x,BLKSIZE=y,RECFM=type) - the DCB (Data Control Block) parameter describes the data set recorded or to be recorded on tape or disk, and should be coded as follows:
  LRECL=x - specifies the record length of the stored data in bytes. LRECL=80 indicates a logical record length of 80 bytes. For variable-length records, LRECL indicates a maximum record length.
  BLKSIZE=y - specifies the physical block length of the data in bytes. For fixed-record length records, 'y' must be a multiple of the LRECL value 'x'. The maximum blocksize allowed on 3390 disk storage is 28,332 (1/2 track) but a maximum of 28,000 is recommended. NOTE: for assistance in calculating the most efficient BLKSIZE for a disk data set, enter the command DISKSTOR from CMS.
  RECFM=type - specifies the characteristics of the records in the data set. 'type' may be any one or a combination of the following:
    A - ANSI (American National Standards Institute) carriage control character accepted for output files routed to the printer
    B - blocked records
    F - fixed length records
    S - standard blocks if fixed length, or spanned records if variable length records
    T - records may be written onto overflow tracks if required.
    U - undefined length records
    V - variable length records
     Following is an example of coding multiple types for RECFM:

 
           //IN1 DD DCB=(RECFM=FB,LRECL=80,BLKSIZE=9040) 
    The RECFM parameter in this example specifies that the records are formatted as fixed, blocked records.

The following optional DCB parameters may be used.
TRTCH=NOCOMP - This parameter may be coded when creating 3480 tape cartridges in instances when you do not wish IDRC compression to be in effect (typically when you are creating a TTV or a tape to be transported to another computer system where IDRC cannot be read). For more information on TRTCH= refer to the TAPES documentation.
DEN=n - Specifies the density used to write data sets to magnetic tape reels; 'n' is a number representing the density in number of bits-per-inch (bpi). One of the following should be coded:

 
           DEN=2 indicates 800 bpi
           DEN=3 indicates 1600 bpi
           DEN=4 indicates 6250 bpi 
NOTE: DEN is not coded for reading or writing tape cartridge (square tape) or disk data sets.
Consult the TAPES documentation for more information concerning the DEN parameter.
DSORG=IS - may be used to specify that the data set is to be organized as an indexed sequential access method (ISAM) data set.
OPTCD=Q - may be used to translate from ASCII to EBCDIC code on input or from EBCDIC to ASCII on output.

For more information on the DCB parameter, consult Related Documentation.

VOL=(,RETAIN,SER=number) - identifies the tape volume on which a data set is located or will be located.
  RETAIN - specifies that the volume (tape) is not to be demounted or rewound after its last use in a job step or at the end of the step (unless the end of the step is also the end of the job).
  SER=number - specifies the serial number of the volume on which the data set is located or will be located. number represents the tape name, which consists of six alphanumeric characters with no imbedded blanks.
NOTE: the VOL parameter should not be used for temporary disk data sets.

The following example requests that the tape numbered 004523 be mounted:

      VOL=SER=004523 


LABEL=(n,labtype,,access) 
- identifies the data set to be accessed, the label type of the tape, and the i/o operation involved.
n - represents an integer that specifies the relative position of a data set on a tape volume.
labtype - specifies the type of label associated with a tape data set. The common types are:
  SL - if the data set has IBM standard labels
  NL - if the data set has no labels
  BLP - if you want label processing to be bypassed (restricted to TTVs
These are the most common 'type' parameters; for more information refer to Related Documentation. See also the TAPES documentation.
access - indicates tape i/o and should be one of the following:
  IN - indicates that the data set is to be processed for input only.
  OUT - specifies that the data set is to be processed for output only.
Note: FORTRAN and SPSS open files by default with read and write access.  When reading data sets with FORTRAN and SPSS programs from a protected tape or from disk, the LABEL parameter should be coded as 'LABEL=(n,labtype,,IN)' for tape data sets, and as 'LABEL=(,,,IN)' for disk data sets.
Note:  When accessing a temporary tape volume (TTV) an extra parameter is required. The LABEL parameter must be specified as follows:
        LABEL=(n,labtype,,access,EXPDT=98000)
The default for the LABEL parameter is: LABEL=(1,SL).



CONCATENATING DATA SETS

By concatenating, several input data sets can be read in sequence as if they were a single data set.  To concatenate data sets, simply omit the ddnames from all the DD statements except the first in the sequence.  In general, the data sets must be located on the same type of storage device (that is, all on disk or all on tape), and they must have the same DCB information.
Example:


   //INPUT1 DD DSN=N1234567.JAN.DATA,DISP=SHR
   //       DD DSN=N1234567.FEB.DATA,DISP=SHR
   //       DD DSN=N1234567.MAR.DATA,DISP=SHR
   //       DD DSN=N1234567.APR.DATA,DISP=SHR 
The above DD statements could be used to string together several data sets, each including data for a different month.  Note that a comma is not coded at the end of each statement.



SUMMARY OF REQUIRED DD PARAMETERS

A summary of the DD parameters necessary for various I/O functions and devices is given below.

INPUT
For input from CMS in the form of input lines to be merged directly following the DD statement, either of the following may be coded:

     //ddname DD *
     //ddname DD DATA,DLM= 
For input from a data set cataloged on disk, code:
    //ddname DD DSN=  ,DISP= 
For input from standard tape, code:
     //ddname DD DSN=  ,DISP=  ,UNIT=  ,VOL=  ,LABEL= 


OUTPUT
For output to paper or CMS code:

     //ddname DD SYSOUT=
For output to disk code:
     //ddname DD DSN=  ,DISP=  ,UNIT=  ,SPACE=  ,DCB= 
For output to tape code:
     //ddname DD DSN=  ,DISP=  ,UNIT=  ,VOL=  ,LABEL=  ,DCB= 
SAS and SPSSX users do not need to code the DCB parameter; SAS and SPSSX provide all the necessary DCB information.

Miscellaneous JCL Statements



The ROUTE Statement

The ROUTE statement specifies the destination of output from a job.  It should follow the JOB statement and precede the EXEC statement.  The format of the ROUTE statement and an explanation of its parameters follow:

     /*ROUTE output destination 
/* - a slash and an asterisk are required in the first and second columns, respectively.
ROUTE - the keyword ROUTE is required in columns 3 through 7.
output - may be either 'PRINT' for printed output or PUNCH for punched output.
destination - may be either 'MVS.LOCAL' for output to be routed to Computer Services, 'MVS.Rxx' for output to be routed to a remote job entry terminal (RJE) ('xx' is the number of the remote site), or 'VM.userid' ('userid' is a CMS userid) for output routed to a CMS terminal.
For example:
   /*ROUTE PRINT MVS.R99 
would route the output to remote 99.

If the ROUTE statement is omitted and MSGCLASS=A has been specified, the output will be routed to its point of origin.  For example, if a job were submitted from CMS under the userid N123456 with no ROUTE statement specified, the output would be sent to the CMS reader of userid N123456.

For information on routing individual data sets generated by a job, refer to the SYSOUT parameter discussed in the DD Statement section and the OUTPUT statement discussed later in this section.



The JOBPARM Statement

The JOBPARM statement specifies job-related parameters including cards, lines, copies, and forms information.  It may be used instead of the accounting parameters on the JOB statement.  Parameters specified in a JOBPARM statement override those specified on the JOB statement.  The JOBPARM statement should follow the JOB statement and precede the EXEC statement (it may come before or after the ROUTE statement).  The format of the JOBPARM statement is:

     /*JOBPARM parameters 
/* - a slash must appear in the first column and an asterisk in the second.
JOBPARM - the keyword JOBPARM must appear in columns 3 through 9.
parameters - the following parameters, which are optional and not positional, may be used; if multiple parameters are coded on a JOBPARM statement they must be separated by commas.
  CARDS=nnnn - specifies estimated number of card images to be punched by the job.
    nnnn represents the number of card images, in tens, to be punched.  The default for the CARDS parameter is 0.  The maximum number of cards that may be punched by a job is 25,000.  It may be abbreviated C=nnnn.
  LINES=nn - specifies the estimated number of lines of printed output for the job.
    nn is an integer representing the number of lines in thousands.  The default for the LINES parameter is 1.  The maximum number of lines that may be printed by a job is 99,000.  The LINES parameter may be abbreviated L=nn.
  COPIES=nn - specifies the desired number of copies of the output.
    nn is an integer that represents the number of copies. The default for the COPIES parameter is 1.  The maximum number of copies that may be printed is 50.  The COPIES parameter may be abbreviated N=nn (COPIES is abbreviated 'N' since CARDS uses 'C.'
  FORMS=xxxx - specifies the special form on which the job is to print.
    xxxx represents a four-character string that indicates which form to use.  The default is standard output paper.  The FORMS parameter may be abbreviated F=xxxx.  For information on forms available from Computer Services, consult the FORMS handout.
  LINECT=nnn - specifies the number of lines to put on each output page (default is 60 lines).  The LINECT parameter may be abbreviated K=nnn.

NOTE:  The JOBPARM statement may not be continued on additional lines.  If more than one line is needed, code multiple JOBPARM statements.  Also note that if multiple JOBPARM statements are present and multiple parameters are specified (two LINES specifications, for example), the last parameter specified is used.
Example:

   /*JOBPARM LINES=2,COPIES=3,FORMS=6995 
This statement specifies that this job may print up to two thousand lines, that three copies of the output should be printed, and that the special form indicated by 6995 should be used instead of standard output paper.  It takes the default for CARDS (0).



The OUTPUT Statement

The OUTPUT statement is used to specify characteristics and/or options of a specific SYSOUT data set or group of SYSOUT data sets (see the discussion of the 'SYSOUT parameter' in the DD Statement section).  Specifically, it can be used to route individual output data sets to CMS.  When used, the OUTPUT statement should follow the JOB statement and come before the EXEC statement.

The general format of the OUTPUT statement for routing data sets to CMS is

     /*OUTPUT code location 
/* - a slash should appear in the first column, an asterisk in the second.
OUTPUT - the keyword OUTPUT should appear in columns 3 through 8.
code - is a four-character forms number created by the user.
location - is a string consisting of the characters 'DEST=VM.' followed by the CMS userid to which output is to be sent.

Example:

   /*OUTPUT XXXX DEST=VM.N123456 
This OUTPUT statement causes output to be sent to userid 'N123456' whenever the forms number 'XXXX' is encountered in the SYSOUT parameter of a DD statement as in the following statement:
   //OUT1 DD SYSOUT=(A,,XXXX) 



The BIN Statement

The BIN statement specifies information to print in the job header that indicates in which output bin to place the printout.  It is used only at RJE sites where job output to be picked up by users is filed in bins.  The general format of the BIN statement is:

     /*BIN xxxx 
/* - a slash should appear in the first column, an asterisk in the second.
BIN - the keyword BIN should appear in columns 3 through 5.
xxxx - represents any four characters identifying an output bin.

Example:

   /*BIN 0011 
This statement will cause 'BIN 0011' to print in the job header.



The Delimiter Statement

The delimiter statement marks the end of data submitted in the input stream (that is, data submitted with a job and not stored on an external device, such as tape or disk).  The format of the delimiter statement is:

   /* comments-field 
/* - a slash is coded in column one; an asterisk in column two.
comments-field - Comments are optional but, if included, must be separated from /* by at least one blank.  NOTE: the comments-field of a delimiter statement cannot be continued on another line.

Following is an example using the delimiter statement.  The beginning of the data in the input stream can be indicated by either a DD * DD statement or a DD DATA DD statement.

 
  //SYSIN DD *
   data
   /*
NOTE:  Sometimes data is supplied within a program (with SAS and SPSSX for example), which means that a delimiter statement is not needed.



The Null Statement

The null statement indicates the end of a job.  The format of the null statement is:

     // 
// - the null statement consists solely of slashes in the first two columns.  It does not have a comments field.

Example:


   // JOB statement
    Other JCL and program statements
   //



The Comment Statement

The comment statement specifies comments to be included in the output listing.  Its format is:

     //*comments 
//* - the comment statement must begin with a slash in the first column , a slash in the second column, and an asterisk in column three.
comments - comments may be entered beginning in column four (a blank comment statement may be coded consisting simply of //*).  NOTE: A comment statement cannot be continued as other JCL statements.  If all comments cannot be coded on one line, add additional comment statements.

Related Documentation

Contact Academic and Research Support at 777-6015 for information on accessing more detailed discussions of the OS/390 operating system running on the USC mvs.sc.edu host.

Informational documentation on various topics related to computer use at USC are available on the web at ARDC Documentation, and at ARS Handouts.

GLOSSARY

This glossary consists of words and abbreviations from this document that may be unfamiliar to some users.  Specific JCL terminology is not included here.  Immediately following the glossary is an index of terms that were defined, enabling you to see how the term is used in the text.

abend - The abnormal ending of a job or part of a job due to programming errors or inappropriate use of resources.
accounting parameters - A set of parameters of the JOB statement that identifies the account number and supplies information concerning the total number of lines, cards, forms, or copies required by a job.
allocate - 1. To assign a resource to or reserve it for a specific task.  2. To reserve blocks of storage for certain information.
allocation/termination messages - Messages output by the operating system indicating how computer resources for a job were allocated, how they were used by the job, and how much was used.
alphanumeric - Consisting of alphabetic characters (A-Z) or digits (0-9).
ANSI - American National Standards Institute.
ASCII - American Standard Code for Information Interchange.  A standard coding method for computer representation of numbers, letters, etc., that uses an seven-bit byte (see 'bit' and 'byte').
bit - An abbreviation of the words Binary digIT.  A bit is a digit (0 or 1) used in the binary numbering system; it represents the smallest amount of information that can be transmitted to or from the computer (see 'bpi').
bpi - An abbreviation for 'bits per inch' (indicates the density of data written on tape).
byte - A contraction of the words 'BinarY TErm'.  A byte is a set of eight binary digits, operated upon as a unit, which represents one character.
cataloged procedure - A set of frequently used job control statements that has been placed in a partitioned data set called the system procedure library.  A cataloged procedure can be used by coding the name of the procedure on an EXEC statement.
CMS - Conversational Monitor System
COBOL - COmmon BCommons Oriented Language (programming language).
compiler - A computer program used to translate other computer programs, written in a high-level language like FORTRAN or PL/I, into the language 'understood' by the computer, that is, machine language.
concatenate - To connect or link data sets or character strings in a series or chain, which is then treated as a single unit.
CPU - An abbreviation for 'central processing unit.'
CS - Computer Services.
data set - A collection of data elements.
default - The choice among exclusive alternatives (that is, a choice among various parameters, operands, keywords, etc.) made by the system when no explicit choice is specified by the user.
disk storage - A form of storage (computer memory) using disks which resemble phonograph records stacked together.
EBCDIC - Extended Binary Coded Decimal Interchange Code; a standard coding method for computer representation of numbers, letters, etc., that uses an eight-bit byte (see 'bit' and 'byte').
file - A named representation, within a program, of a data set.
form - Refers to the type of output material on which a printer prints output.
FORTRAN - FORmula TRANslator (programming language).
IBM - International Business Machines Corp.
I/O - input/output.
JCL - Job Control Language.
job - A collection of related tasks to be carried out by the computer.  A job is identified in the input stream by a JOB statement followed by one or more EXEC statements.
K - 1024 bytes, thus 256K = 256 X 1024.
keyword - A symbol or name that identifies a statement, parameter, or parameter.
library tape - A tape which is entered into the CS Tape Library on a long-term basis and assigned a system vol=ser by the Tape Librarian.
linkage editor - A program that combines into a single program (load module), a number of program segments that have been compiled independently (see 'load module').
load module - The output from the linkage editor (see 'linkage editor').  It consists of the user's program in machine-executable code linked with any external procedures or libraries needed by the program.
machine language - A language (set of instructions, symbols, rules) used directly by a given computer (see 'compiler').
national character - One of the following special characters: an 'at' sign (@), a pound sign (#), or a dollar sign ($).  A national character is usually considered alphabetic.
operand - Information entered with a keyword that defines or modifies the action indicated by the keyword.
operating system - A set of computer programs that directs the operation of a computer.
parameter - A variable that is given a particular value for a specific purpose or process.
partitioned data set (PDS) - A data set divided into segments (partitions), called members, each of which can contain a program or part of a program.  Each PDS contains a directory of member names and their storage locations.
password - A set of characters used to control access to the parts of a computer system (including access to the computer itself, to data sets, etc.).
PDS - See 'partitioned data set'.
positional - Refers to a parameter or keyword that must appear in a specified position or order.
process - A general term for what a computer does, that is, it inputs data, operates on it in some way, and produces output based on those operations.
program - A sequence of instructions that enables the computer to solve a problem or accomplish an objective.
RACF - Resource Access Control Facility; controls access to data sets on the USC system.
record - A group of related data items treated as a unit.  For example, one record in a data set made up of personnel information might consist of the information for a single employee.
RJE - remote job entry.
SAS - Statistical Analysis System (statistical package).
spanned records - Records that extend over more than one block of records.
SPSSX - Statistical Package for the Social Sciences.
standard label (SL) - IBM's standard type of tape label.
statement - An instruction to the computer.
step - A unit of work in a job.  An EXEC statement marks the beginning of a step.  One or more steps make up a job.
stream input/output - Transmission of data items as a continuous stream of characters.
submit - To transmit a job to the computer to be processed.
temporary tape volume (TTV) - A private tape which is entered into the CS tape library for a week or less at a time.  TTVs are not assigned a vol=ser by the Tape Librarian.  See 'library tape'.
utility program (utilities) - A program written in a low-level language to perform a specific task required by many or most of the users of a computer system.  The most common group of utility programs are those that copy information from one medium to another.  Examples of utility programs are:  IEBGENER (copies data sets from one medium to another), DSUTIL (manages storage of and access to data sets), and USCSORT (sorts data sets).
volume - A standard unit of auxiliary storage, a reel of magnetic tape, a disk pack, or a drum.

ARDC Documentation     ARDC Home Page     USC Home Page    

*SAS is the registered trademark of SAS Institute Inc., Cary, N.C. 27511, U.S.A.

This page updated September 17, 1999 by Amy W. Yarbrough, Academic Research and Data Center.
Copyright © 1999, The Board of Trustees of the University of South Carolina.
URL http://www.sc.edu/ardc/docs/jcl.htm