CL Command Reference - SBMJOB

CL Command List > SBMJOB Reference

Description:

The Submit Job (SBMJOB) command allows a job that is running to submit another job to a job queue to be run later as a batch job. Only one element of request data can be placed on the new jobĄ¯s message queue. The request data can be a CL command if the routing entry used for the job specifies a CL command processing program (such as the IBM-supplied QCMD program).

Note: A job started by the SBMJOB command uses the Accounting code (ACGCDE) of the job that submits the job. The ACGCDE specifications in the submitted jobĄ¯s job description (JOBD) and userĄ¯s user profile (USRPRF) are ignored.

Restrictions:

1. The user that issues the SBMJOB command must have:
. use (*USE) authority to the user profile specified on the User (USER) parameter.
. use (*USE) authority to the command specified on the Command to run (CMD) parameter and execute (*EXECUTE) authority to the library containing that command.
. use (*USE) authority to the job description specified on the Job description (JOBD) parameter and execute (*EXECUTE) authority to the library containing that job description.
. use (*USE) authority to the job queue specified on the Job queue (JOBQ) parameter and execute (*EXECUTE) authority to the library containing that job queue.
. use (*USE) and add (*ADD) authority to the message queue specified on the Message queue (MSGQ) parameter and execute (*EXECUTE) authority to the library containing that message queue.
. job control (*JOBCTL) special authority to use the Submitted for (SBMFOR) parameter.

2. The user for the submitted job must have:
. use (*USE) authority to the job description specified on the Job description (JOBD) parameter.
. read (*READ) authority to the output queue specified on the Output queue (OUTQ) parameter and execute (*EXECUTE) authority to the library, in the submitted jobĄ¯s name space, that contains that output queue.
. use (*USE) authority to all the libraries specified on the System library list (SYSLIBL) parameter.
. use (*USE) authority to the library specified on the Current library (CURLIB) parameter.
. use (*USE) authority to all the libraries specified on the Initial library list (INLLIBL) parameter.
. use (*USE) authority to all auxiliary storage pool (ASP) device descriptions specified on the Initial ASP group (INLASPGRP) parameter.
. use (*USE) authority to the sort sequence table specified on the Sort sequence (SRTSEQ) parameter and execute (*EXECUTE) authority to the library, in the submitted jobĄ¯s name space, that contains that sort sequence table.

3. This command is conditionally threadsafe. If a Job Notification Exit Point has been registered to send a message to a DDM data queue whenever a Submit Job is done, the message will not be sent if SBMJOB command is issued in a multithreaded job. For more information on the Job Notification function, refer to the Job Notification Exit Point in the Work Management chapter of the System API Reference manual.


Examples:

Example 1: Submitting a Job

SBMJOB JOB(SPECIAL) JOBD(MYLIB/MYJOBD) CMD(CALL MYPROG)

This command causes the job named SPECIAL to be submitted. Most of the attributes for the job are taken from the job description MYJOBD, or the job that is currently running, except for the command. The CALL command is placed on the submitted jobĄ¯s message queue so that the program MYPROG can be called and run later.



Example 2: Submitting a Job

SBMJOB JOB(PAYROLL) JOBD(PAYROLL) INQMSGRPY(*RQD)

This command submits a job named PAYROLL to the system. All the information needed for this job (such as the job queue and routing data but not the inquiry message control value) is contained in the job description PAYROLL, or the job that is currently running. The library list in effect for the job issuing this command is used to find the job description. All inquiry messages sent during running of this job requires the receiver of the inquiry message to reply.



Example 3: Submitting a Job to a Job Queue

SBMJOB JOBD(*USRPRF) JOB(COPY12) JOBQ(NIGHTQ) CMD(CPYF FILEA FILEB)

This command submits the job COPY12, which uses the job description in the user profile of the submitting job, to the job queue NIGHTQ. The CMD parameter provides the CL command necessary for the job to run. A command such as this might be used to copy the file at night while the system is unattended.