CL Command Reference - BCHJOB
CL Command List > BCHJOB Reference
Description:
The Batch Job (BCHJOB) command indicates the beginning of a batch job in a batch input stream. It can also specify different values for the attributes for the job instead of the ones specified in the job description or user profile for this job. The values contained in the job description or in the user profile named in that job description are used for most parameters not coded in the BCHJOB command.
Restrictions:
The user that issues the Start Data Base Reader (STRDBRDR), Submit Data Base Jobs (SBMDBJOB), Start Diskette Reader (STRDKTRDR), or Submit Diskette Jobs (SBMDKTJOB) command is considered the user issuing the the BCHJOB command.
1. To use this command, the user that issues the BCHJOB command must have:
. use (*USE) authority to the job description (JOBD) and execute (*EXECUTE) authority to the library that contains that job description.
. use (*USE) authority to the job queue (JOBQ) and execute (*EXECUTE) authority to the library that contains that job queue.
. use (*USE) authority to all libraries specified for the system value QSYSLIBL, the Current library (CURLIB) parameter, and the Initial library list (INLLIBL) parameter.
. use (*USE) and add (*ADD) authority to the message queue (MSGQ) and execute (*EXECUTE) authority to the library. that contains that message queue.
. use (*USE) authority to the user profile in the job description.
. execute (*EXECUTE) authority to all of the device descriptions in the auxiliary storage pool (ASP) group of the jobĄ¯s name space.
2. The user specified in the job description of the submitted job must have:
. use (*USE) authority to the job description (JOBD).
. read (*READ) authority to the output queue (OUTQ) and execute (*EXECUTE) authority to the library that contains that output queue.
. use (*USE) authority to all libraries specified for the system value QSYSLIBL, the Current library (CURLIB) parameter, and the Initial library list (INLLIBL) parameter.
. use (*USE) authority to the sort sequence table (SRTSEQ) and execute (*EXECUTE) authority to the library that contains that sort sequence table.
. use (*USE) authority to all of the device descriptions in the Initial ASP group (INLASPGRP) of the job description.
3. The BCHJOB command cannot be used from a work station.
4. Two slashes must precede this command name when entering it in the data record: //BCHJOB or // BCHJOB. (The user can separate the slashes from the command name with blank spaces).
5. The current value of the auxiliary storage pool (ASP) group for the thread issuing the Submit Data Base Jobs (SBMDBJOB) or Submit Diskette Jobs (SBMDKTJOB) command is used for the initial ASP group parameter of the submitted batch job. Similarly, the current value of the ASP group for the thread issuing the Start Data Base Reader (STRDBRDR) or Start Diskette Reader (STRDKTRDR) command is used for the initial ASP group parameter of the spool reader job and is used for the initial ASP group parameter of the submitted batch job. The initial ASP group value in the job description is ignored. The processing of the BCHJOB command and the processing of spool reader functions such as syntax checking must operate in the name space used by the batch job.
Examples:
Example 1: Checking System Reply List for Inquiry Message Entries
BCHJOB JOBD(PAYROLL) INQMSGRPY(*SYSRPYL)
This command begins the batch job called PAYROLL. An inquiry message that is sent (as a result of running this job) that has an entry in the system reply list is answered according to the reply in that reply list entry. For any inquiry message not represented in the reply list, a reply is required.
The job name is the same as the name of the job description used with the job. The library search list of the thread in which the BCHJOB command is processed determines where the job description PAYROLL is found. The auxiliary storage pool (ASP) group of the thread in which the BCHJOB command is processed is used as the initial ASP group of the new job. Values for other job attributes are taken from the job description PAYROLL or from the user profile named in the job description PAYROLL.
Example 2: Setting Job Switches
BCHJOB JOBD(QGPL/QBATCH) JOB(PAYROLL) JOBQ(BATCH2)
INLLIBL(PAYLIB) SWS(00101100) DATE(010188)
This command begins a batch job called PAYROLL, which is run using attributes from the IBM-supplied job description for batch jobs, QBATCH. The job is placed on the job queue BATCH2. The library PAYLIB is the only library in the user portion of the library list. Switches are set for use in the job, and the date is set at January 1, 1988.
Example 3: Specifying Severity Levels
BCHJOB JOBD(COMPILE) JOBPTY(5) SYNTAX(10)
INLLIBL(MYCMDS) ENDSEV(40)
This command begins a batch job called COMPILE. The job is run using all of the attributes described in the job description also named COMPILE, except for the initial ASP group and the parameters that are specified by this command. The library MYCMDS is the only library in the user portion of the library list to be used when the commands are checked for syntax or run. Syntax errors with a value equal to or greater than 10 end processing of the job. The job is assigned a scheduling priority of 5 and is run as long as no errors are encountered that cause an escape message to be sent that has a severity level of 40 or higher.