JOB statement to mark the beginning of a job and to tell the system how to process the job. Also, when jobs are stacked in the input stream, the JOB statement marks the end of the preceding job.
//jobname JOB positional-parameters[,keyword-parameter]... [comments]
The parameters you can specify for job processing are listed below. Also we provided explanation for some of the important parameters.
Accounting information Parameter:
The value that you code for job accounting information depends on the guidelines set at your company. The value is usually a number that identifies a department or person to whom processor time is billed.
Job accounting information may consist of multiple pieces of information, not just a single value as shown in this example.
//JOB43 JOB D548-8686
//JOB44 JOB (D548-8686,'12/8/85',PGMBIN)
Because this statement contains an account-number plus additional accounting-information, parentheses are required.
//JOB45 JOB (CFH1,2G14,15,,,,2)
This statement shows a JES2 accounting information parameter: programmer’s accounting number, CFH1; room number, 2G14; estimated job time, 15 minutes; and copies, 2. Parentheses are required. Standard values are assumed for the other JES2 subparameters.
Use the CLASS parameter if your company uses classes to group jobs. Grouping jobs helps to:
Because jobs classes are site-specific, you have to check with your operations department to determine which job classes are available for use.
CLASS=0 to 9 | A to Z
//SETUP JOB 1249,SMITH,CLASS=M
This statement assigns the job to class M.
A COND parameter can be coded in the JOB or EXEC statement of JCL. It is a test on the return code of the preceding job steps. If the test is evaluated to be true, the current job step execution is bypassed. Bypassing is just omission of the job step and not an abnormal termination. There can be at most eight conditions combined in a single test.
//TYPE JOB (611,402),BOURNE,COND=(7,LT)
The COND parameter specifies that if 7 is less than the return code, the system terminates the job. Any return code less than or equal to 7 allows the job to continue.
//TEST JOB 501,BAXTER,COND=((20,GE),(30,LT))
The COND parameter specifies that if 20 is greater than or equal to the return code or if 30 is less than the return code, the system terminates the job. Any code of 21 through 30 allows the job to continue.
You can use the MSGCLASS keyword parameter to assign an output class for your output listing (SYSOUT). Output classes are defined by the installation to designate unit record devices, such as printers.
MSGCLASS parameters have default settings, depending on your company's guidelines. The operating system uses the default setting if you omit this parameters from the JOB statement. In this case, you would code these parameters only if you want to have a different message class than the preset values.
//EXMP1 JOB ,GEORGE,MSGCLASS=F
In this example, the JOB statement specifies output class F for the job log.
//EXMP2 JOB ,MENTLE,MSGLEVEL=(2,0)
This JOB statement does not specify an output class. In this case, the output class defaults to the installation default output class for the device from which the job was submitted.
//A1403 JOB ,BLACK,MSGCLASS=L //STEP1 EXEC PGM=PRINT //OUTDD1 DD SYSOUT=L
In this example, the JOB statement and sysout DD statement OUTDD1 both specify the same output class. Consequently, the job log and data set OUTDD1 are written on the same output listing.
//B209 JOB ,WHITE,MSGCLASS=M //STEPA EXEC PGM=PRINT //OUTDDX DD SYSOUT=*
In this example, the JOB statement specifies that the system route the job log to output class M. The system also routes sysout data set OUTDDX to class M because SYSOUT=* is specified.
The MSGLEVEL parameter controls how the JCL, allocation messages, and termination messages are printed in the job's output listing (SYSOUT).
The MSGLEVEL parameter value consists of two subparameters:
statement The statement subparameter indicates which job control statements the system is to print on the job log.
messages The messages subparameter indicates which messages the system is to print on the job log.
MSGLEVEL have default settings, depending on your company's guidelines. The operating system uses the default setting if you omit this parameters from the JOB statement. In this case, you would code these parameters only if you want to have a different message level than the preset values.
//EXMP3 JOB ,GEORGE,MSGLEVEL=(2,1)
In this example, the JOB statement requests that the system print JCL statements, JCL messages, JES and operator messages, and SMS messages.
//EXMP4 JOB ,MENTLE,MSGLEVEL=0
In this example, the JOB statement requests that the system print the JOB statement and any comments and JECL statements up to the first EXEC statement; and, that JES is to use the installation default for messages.
//EXMP5 JOB ,MIKE,MSGLEVEL=(,0)
In this example, the JOB statement requests that JES use the installation default for printing JCL statements and the system is not to print JES and operator messages unless the job abnormally terminates. SMS messages are printed only if SMS fails the job.
The system sends the success or failure message (Maximum Condition Code) to the user specified in this parameter. Following is the syntax:
NOTIFY="userid | &SYSUID"
Here system sends the message to the user "userid" but if we use NOTIFY = &SYSUID, then the message is sent to the user submitting the JCL.
//SIGN JOB ,TKLOMP,NOTIFY=USERID
When the job SIGN completes processing, the system sends a message to user USERID.
//SIGN JOB ,TKLOMP,NOTIFY=&SYSUID
When the job SIGN completes processing, the system sends a message to the user submitting the JCL.
Programmer’s name Parameter:
The programmer name identifies the person or group responsible for a job. The programmer's name is not a mandatory part of the JOB statement unless your company has made it so.
Place the programmer’s name parameter immediately after the accounting information parameter and before all keyword parameters.
The name contains special characters (including blanks), other than hyphens, leading periods, or embedded periods.
//APP JOB ,G.M.HILL
This JOB statement specifies a programmer’s name with no accounting information. The leading comma may be optional; check with your installation.
//DELTA JOB 'T.O''NEILL'
The programmer’s name contains special characters. The installation requires no accounting information. The imbedded apostrophe is coded as two consecutive apostrophes; the entire name must be enclosed in apostrophes.
//#308 JOB (846349,GROUP12),MATTHEW
This JOB statement specifies an account number, additional accounting information, and a programmer’s name.
//JOBA JOB 'DEPT. 15E'
This installation requires the department number in the programmer’s name parameter.
Specifies the address space required to run a job step within the job. Following is the syntax:
REGION=valueK | valueM
Here, region can be specified as valueK or n=valueM where value is a number, K is kilobyte and M is Megabyte.
When REGION = 0K or 0M, largest address space is provided for execution.In critical applications, coding of 0K or 0M is prohibited to avoid wasting the address space.
//ACCT1 JOB A23,SMITH,REGION=100K,ADDRSPC=REAL
This JOB statement indicates that the job requires 100K of central storage.
//ACCT5 JOB 178,SRI,REGION=0K
This JOB statement indicates that the job requires largest address space is provided for execution
//ACCT4 JOB 175,FRED,REGION=250K
This JOB statement indicates that the job requires 250K of virtual storage. When the ADDRSPC parameter is omitted, the system defaults to ADDRSPC=VIRT.
The RESTART parameter to indicate the step, procedure step, or checkpoint at which the system is to restart a job.
RESTART = [stepname] [stepname.procstepname]
//LINES JOB '1/17/95',RESTART=COUNT
This JOB statement indicates that the system is to restart execution at the beginning of the job step named COUNT.
//CLIP5 JOB ,COLLINS,RESTART=PAY.WEEKLY
This JOB statement indicates that the system is to restart execution at the procedure step WEEKLY.PAY is the name field on the EXEC statement that calls the cataloged procedure that contains procedure step WEEKLY.
Use the TIME parameter to specify the maximum amount of time that a job may use the processor or to find out through messages how much processor time a job used. Using the TIME parameter prevents an error in your program from causing it to run longer than necessary.
TIME=(mm, ss) or TIME=ss
Where mm = minutes and ss = seconds
You can use the TIME parameter on a JOB statement to decrease the amount of processor time available to a job or job step below the default value. You cannot use the TIME parameter on a JOB statement to increase the amount of time available.
//FIRST JOB ,SMITH,TIME=2 //STEP1 EXEC PGM=READER,TIME=1 . . . //STEP2 EXEC PGM=WRITER,TIME=1 .
In this example, the job is allowed 2 minutes for execution and each step is allowed 1 minute. If either step continues executing beyond 1 minute, the entire job abnormally terminates beginning with that step.
//SECOND JOB ,JONES,TIME=3 //STEP1 EXEC PGM=ADDER,TIME=2 . . . //STEP2 EXEC PGM=PRINT,TIME=2 .
In this example, the job is allowed 3 minutes for execution, and each step is allowed 2 minutes. If either step continues executing beyond 2 minutes, the entire job abnormally terminates beginning with that step. If STEP1 executes for 1.74 minutes and STEP2 tries to execute beyond 1.26 minutes, the job abnormally terminates because of the 3-minute limit specified on the JOB statement.
USER parameter used to identify the User id to submit the job. The userid is used by RACF, the system resources manager (SRM), and other system components.
//TEST JOB 'D83,123456',USER=MYNAME,PASSWORD=ABCD
This statement identifies the user submitting this job as MYNAME.
If you have any doubts or queries related to this chapter, get them clarified from our Mainframe experts on ibmmainframer Community!