SBMJOB (Submit Job)

SBMJOB Command syntax diagram

 

Purpose

The Submit Job (SBMJOB) command allows a job that is being run 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 in 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.

Note: A job started by the SBMJOB command uses the accounting code of the job that submits the job. The accounting code specifications on the submitted jobs' JOBD and USRPRF parameters are ignored.

 

Restrictions

This command is conditionally threadsafe. The following restrictions apply:

  1. To submit a job that runs under a different user profile, have *USE authority to that user profile.

  2. The user that issues the Submit Job command must have

    • *USE authority to the command specified by the CMD (command to run) parameter and *EXECUTE authority to the library containing that command.
    • *READ authority to the job description (JOBD) and *EXECUTE authority to the library containing that job description.
    • *USE authority to the job queue (JOBQ) and *EXECUTE authority to the library containing that job queue.
    • *USE plus *ADD authority to the message queue (MSGQ) and *EXECUTE authority to the library containing that message queue.
    • *USE authority to the sort sequence table (SRTSEQ) and *EXECUTE authority to the library containing that sort sequence table.
    • *EXECUTE authority to all auxiliary storage pool (ASP) device descriptions in the initial ASP group (INLASPGRP).


  3. The user for the submitted job must have

    • *USE authority to the job description (JOBD).
    • *READ authority to the output queue (OUTQ) and *EXECUTE authority to the library containing that output queue.
    • *USE authority to all auxiliary storage pool (ASP) device descriptions in the initial ASP group (INLASPGRP).
    • *USE authority to the library specified for the current library (CURLIB) parameter.
    • *USE authority to all the libraries specified for the initial library list (INLLIBL) parameter.



  4. 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 the 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 Application Program Interfaces (APIs) topic in the Information Center.

 

Optional Parameters

JOB
Specifies the job name that is associated with the submitted job while it is being processed by the system.

*JOBD: The simple name of the job description used with this job is the name of the job itself.

job-name: Specify the simple name of the job that is used while it is being processed by the system.

JOBD
Specifies the job description used to submit jobs for batch processing.

*USRPRF: The job description specified in the user profile under which the submitted job runs is used. The user profile is specified on the USER parameter.

The name of the job description can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

job-description-name: Specify the name of the job description.

USER
Specifies the name of the user profile under which the job is submitted. USER(*JOBD) is not valid when USER(*RQD) is specified on the Create Job Description (CRTJOBD) command.

*CURRENT: The user profile that is currently running is used.

*JOBD: The user profile name in the specified job description is used for the job being submitted.

When the system is running under security level 40, the user of this command must be authorized to the user specified in the job description.

user-name: Specify the user profile name that is used for the submitted job. The user must be authorized to the user profile and the job description; the user profile must also be authorized to the job description (JOBD).

JOBQ
Specifies the qualified name of the job queue on which this job is placed.

*JOBD: The submitted job is placed on the job queue named in the specified job description.

The name of the job queue can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

job-queue-name: Specify the qualified name of the job queue on which the submitted job is placed.

JOBPTY
Specifies the scheduling priority for the submitted job. Valid values range from 1 through 9, where 1 is the highest priority and 9 is the lowest priority. More information on this parameter is in Commonly used parameters.

*JOBD: The scheduling priority specified in the job description is used.

scheduling-priority: Specify a value, ranging from 1 through 9, for the scheduling priority for the job.

OUTPTY
Specifies the output priority for spooled files that are produced by the submitted job. The highest priority is 1 and the lowest priority is 9. More information on this parameter is in Commonly used parameters.

*JOBD: The output priority specified in the job description is used for the job.

output-priority: Specify a value, ranging from 1 through 9, for the priority of the output files of the submitted job.

PRTTXT
Specifies up to 30 characters of text to be printed at the bottom of each page of output. More information on this parameter is in Commonly used parameters.

*CURRENT: The same print text of the submitting job is used.

*JOBD: The value in the job description is used.

*SYSVAL: The system value (QPRTTXT) is used.

*BLANK: Text is not specified.

'print-text': Specify the character string that is printed at the bottom of each page. Up to 30 characters can be entered, enclosed in apostrophes.

RTGDTA
Specifies the routing data that is used with this job description to start jobs. The routing data is used to determine the routing entry (in the subsystem description) that identifies the program in which the job runs.

QCMDB: The routing data used by the IBM-supplied batch subsystem, QBATCH, to route batch jobs to the IBM-supplied control language processor QCMD is used.

*JOBD: The routing data specified in the job description is used to start the routing step.

*RQSDTA: Up to 80 characters of the request data specified in the RQSDTA parameter of this command is used as the routing data for the job.

'routing-data': Specify the character string that is used as the routing data for starting the job. Up to 80 characters can be entered enclosed in apostrophes, if necessary.

CMD
Specifies the command that runs in the submitted job. The IBM-supplied default routing program QCMD must be used when the job is started or the job will not run. Because the command you specify is used for the request data, the value specified on the RQSDTA parameter in the job description is ignored. The command can be a maximum of 20000 characters in length.

RQSDTA
Specifies the request data that is placed in the submitted job's message queue. For example, if RTGDTA (QCMDB) is specified, the IBM-supplied batch subsystem, QBATCH, is used, and a CL command is supplied, it becomes a message that is read by the control language processor, QCMD.

*CMD: The input from the CMD parameter is placed in this job's message queue.

*JOBD: The request data specified in the job description used by the job is placed in this job's message queue.

*NONE: No request data is placed in the job's message queue.

*RTGDTA: The routing data specified in the RTGDTA parameter of this command is placed as the last entry in the job's message queue.

'request-data': Specify the character string that is placed as the last entry in the submitted job's message queue. Up to 3000 characters can be entered, enclosed in apostrophes, if necessary. When a CL command is entered, it must be enclosed in single apostrophes, and where apostrophes would normally be used inside the command, double apostrophes must be used instead.

SYSLIBL
Specifies the system portion of the library being used by the submitted job.

*CURRENT: The system portion of the library list of the submitting job is used.

*SYSVAL: The library list specified in the system value (QSYSLIBL) at the time the job is started is used for the submitted job.

CURLIB
Specifies the name of the library being used as the current library for jobs initiated by this user profile.

*CURRENT: The current library for the job is used for the submitted job.

*USRPRF: The current library specified in the user profile under which the submitted job runs is used. The user profile is specified on the USER parameter.

*CRTDFT: There is no current library for the submitted job. If objects are created in the current library, the QGPL library is used as the default current library.

current-library-name: Specify the name of the library that is used as the current library of the submitted job.

INLLIBL
Specifies the user portion of the first library list that is used by the submitted job to search for any object names that are specified without a library qualifier. This does not include the system portion of the library list.

Note: Duplication of libraries in the library list is not allowed.

*CURRENT: The user portion of the library list being used by the current job is used for the submitted job.

*JOBD: The library list specified in the job description used with the job is used as the first library list for the job.

*SYSVAL: The system default library list, QUSRLIBL, is used by the job.

*NONE: The user portion of the first library list is empty; only the system portion is used.

library-name: Specify the names of one or more libraries that are in the user portion of the library list and are used by the submitted job. No more than 250 names can be specified. The libraries are searched in the same order as they are listed.

LOG
Specifies the message logging values used to determine the amount and type of information sent to the job log by this job. This parameter has three elements: the message (or logging) level, the message severity, and the level of message text. If no values are specified on this parameter, the values specified in the job description associated with this job are used.

Element 1: Message Level

*JOBD: The value specified for message logging in the job description is used for the submitted job.

message-level: Specify a value, ranging from 0 through 4, that specifies the message logging level used for the submitted job's messages. For additional information on the message levels, refer to "Message Level" under the LOG parameter of the Create Job Description (CRTJOBD) command.

Element 2: Message Severity

*JOBD: The value specified for message logging in the job description is used for the submitted job.

message-severity: Specify a value, ranging from 00 through 99, that is used in conjunction with the logging level to determine which error messages are logged in the job log. More information on this parameter is in Commonly used parameters.

Element 3: Message Text Level

*JOBD: The value specified for message logging in the job description is used for the submitted job.

*MSG: Only the message text is written to the job log.

*SECLVL: Both the message text and the message help (cause and recovery) of the error message are written to the job log.

*NOLIST: If the job ends normally, no job log is produced. If the job ends abnormally (if the job end code is 20 or higher), a job log is produced. The messages that appear in the job log contain both the message text and the message help.

LOGCLPGM
Specifies whether the commands that have run in a control language program are logged to the job log by way of the CL program's message queue. This parameter sets the status of the job's logging flag. If *NO is specified, the logging flag status is off and CL commands are not logged. If *YES is specified and the LOG (*JOB) value is specified in the Create CL Program (CRTCLPGM) command, all commands in the CL program that can be logged are logged to the job log.

For more information on request logging, refer to the LOG parameter in the CRTCLPGM command description.

*JOBD: The value specified in the job description is used.

*NO: The commands in a CL program are not logged to the job log.

*YES: Commands in a CL program are logged to the job log.

INQMSGRPY
Specifies the way that predefined messages that are sent as a result of running this job are answered. The user can specify that no change is made in the way that predefined messages are answered, that all inquiry messages require a reply, that a default reply be issued, or that the system reply list is checked for a matching reply as each predefined inquiry message is sent. Refer to the Add Reply List Entry (ADDRPYLE) command description for more information.

*JOBD: The inquiry message reply control specified in the job description used with this job is used.

*RQD: A reply is required by the receiver of the inquiry message for all inquiry messages that occur when this command is run.

*DFT: The default reply to the inquiry message is sent. If no default reply is specified in the message description of the inquiry message, the system default reply, *N, is used.

*SYSRPYL: The system reply list is checked to see if there is an entry for an inquiry message that is issued as a result of running this job that has a message identifier and any comparison data that match the inquiry message identifier and message data. If a match occurs, the reply value in that entry is used. If no entry exists for that message, a reply is required.

PRTDEV
Specifies the name of the default printer device for this job. If the printer file being used to create the output specifies to spool the file, the spooled file is placed on the device's output queue, which is named the same as the device.

Note: This assumes the defaults are specified on the OUTQ parameter for the printer file, job description, user profile and workstation.

*CURRENT: The printer device being used by the job that is currently running is used by the submitted job.

*USRPRF: The printer device specified in the user profile under which the submitted job runs is used. The user profile is specified on the USER parameter.

*SYSVAL: The value specified in the system value QPRTDEV is used.

*JOBD: The printer device specified in the job description is used for the submitted job.

printer-device-name: Specify the name of the printer device that is used for the submitted job.

OUTQ
Specifies the qualified name of the output queue used for spooled files that specify OUTQ(*JOB). This parameter applies only to printer files that have *JOB specified on the OUTQ parameter.

*CURRENT: The output queue used by the current job is used for the submitted job.

*USRPRF: The output queue specified in the user profile under which the submitted job runs is used. The user profile is specified on the USER parameter.

*DEV: The output queue specified on the PRTDEV parameter is used.

*JOBD: The output queue named in the job description used with the submitted job is the job's default output queue.

The name of the output queue can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

output-queue-name: Specify the qualified name of the output queue that is used as the default output queue by the submitted job.

HOLD
Specifies whether jobs using this job description are placed on the job queue in the hold condition. A job placed on the job queue in the hold condition is held until it is either released by the Release Job (RLSJOB) command or canceled by the End Job (ENDJOB) or Clear Job Queue (CLRJOBQ) command. If the job is not run before the next power-down of the system, the job queue can be cleared (and the job ended) when the next initial program load (IPL) is done.

*JOBD: The value specified in the job description determines whether the job is held when it is put in the job queue.

*NO: The job is not held when it is put in the job queue.

*YES: The job is held when it is put on the job queue until it is released by a Release Job (RLSJOB) command or ended by a End Job (ENDJOB) command.

SCDDATE
Specifies the date on which the submitted job becomes eligible to run.

If your system or your job is configured to use the Julian date format, the *MONTHSTR and *MONTHEND values are calculated as if the system or job did not use the Julian date format.

*CURRENT: The submitted job becomes eligible to run on the current date.

*MONTHSTR: The submitted job becomes eligible to run on the first day of the month. If you specify *MONTHSTR, and if today is the first day of the month, and if the time you specify on the SCDTIME parameter has not passed, the job is eligible to run today. Otherwise, the job becomes eligible to run on the first day of the next month.

*MONTHEND: The submitted job becomes eligible to run on the last day of the month. If you specify *MONTHEND, and if today is the last day of the month, and if the time you specify on the SCDTIME parameter has not passed, the job is eligible to run today. Otherwise, the job becomes eligible to run on the last day of the next month.

*MON: The job becomes eligible to run on Monday.

*TUE: The job becomes eligible to run on Tuesday.

*WED: The job becomes eligible to run on Wednesday.

*THU: The job becomes eligible to run on Thursday.

*FRI: The job becomes eligible to run on Friday.

*SAT: The job becomes eligible to run on Saturday.

*SUN: The job becomes eligible to run on Sunday.

date: Specify a date in the job date format with or without separators.

SCDTIME
Specifies the time on the scheduled date at which the job becomes eligible to run.

Note: Although the time can be specified to the second, the activity involved in submitting a job and the load on the system may affect the exact time at which the job becomes eligible to run.

The order that job entries with identical SCDDATE and SCDTIME values appear on the job queue may be different than the order in which they arrived. Likewise, these jobs may leave the job queue to be processed in an order different than the order in which they were entered. Do not assume jobs are entered or processed sequentially when they are scheduled to start at exactly the same time.

*CURRENT: The current time is used.

time: Specify a time in the system format with or without separators defined for the job.

DATE
Specifies the date that is assigned to the submitted job when it is started.

*JOBD: The date specified in the job description is used as the job date.

*SYSVAL: The value in the QDATE system value at the time the job is started is used as the job date.

job-date: Specify the value that is used as the job date when the job is started. The date must be in the job date format. Possible formats are in the CL Programming

book.

SWS
Specifies the first settings for a group of eight job switches that are used with the submitted job. These switches can be set or tested in a CL program and used to control the flow of the program. For example, if a certain switch is on, another program can be called. The job switches may also be valid in other high-level language programs. Only 0's (off) and 1's (on) can be specified in the 8-digit character string.

*JOBD: The value specified in the job description is the first setting for the job's switches.

switch-settings: Specify any combination of eight 0's and 1's that is used as the first switch setting for the submitted job.

DSPSBMJOB
Specifies whether the job being submitted is allowed to be shown on the Submitted Jobs Display. Any submitted job of the type specified by the SBMFROM parameter of the Work with Submit Job (WRKSBMJOB) command can be shown if the job is not prevented by this parameter.

*YES: This job can be shown by the WRKSBMJOB command.

*NO: This job is not shown on any display produced by the WRKSBMJOB command.

MSGQ
Specifies the qualified name of the message queue to which messages are sent.

Note: If a job ends abnormally, the online help information of the completion message sent specifies the possible causes.

*USRPRF: A completion message is sent to the message queue specified in the user profile of the user who submits the job.

*WRKSTN: A completion message is sent to the work station message queue of the work station from which the job was submitted. If the job is submitted by a batch job, no completion message is sent.

*NONE: No completion message is sent.

The name of the message queue can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

message-queue-name: Specify the name of the message queue to which messages are sent.

SRTSEQ
Specifies the sort sequence table to be used for string comparisons for this job.

*CURRENT: The sort table specified for the job that is currently running is used.

*SYSVAL: The system value QSRTSEQ is used.

*USRPRF: The sort table specified in the user profile under which the submitted job runs is used. The user profile is specified on the USER parameter.

*HEX: A sort sequence table is not used. The hexadecimal values of the characters are used to determine the sort sequence.

*LANGIDUNQ: A unique-weight sort table is used.

*LANGIDSHR: A shared-weight sort table is used.

The name of the sort sequence table can be qualified by one of the following library values:

*LIBL: All libraries in the job's library list are searched until the first match is found.

*CURLIB: The current library for the job is searched. If no library is specified as the current library for the job, the QGPL library is used.

library-name: Specify the name of the library to be searched.

table-name: Specify the name of the sort sequence table to be used with this job.

LANGID
Specifies the language identifier to be associated with this job. The language identifier is used when *LANGIDUNQ or *LANGIDSHR is specified on the sort sequence prompt (SRTSEQ parameter). If the job CCSID is 65535, this parameter is also used to determine the value of the job default CCSID (DFTCCSID).

*CURRENT: The language identifier specified for the job that is currently running is used.

*SYSVAL: The system value QLANGID is used.

*USRPRF: The language ID specified in the user profile under which the submitted job runs is used. The user profile is specified on the USER parameter.

language-ID: Specify the language identifier to be used by the job.

CNTRYID
Specifies the country or region identifier to be used by the job.

*CURRENT: The country or region identifier specified for the job that is currently running is used.

*SYSVAL: The system value QCNTRYID is used.

*USRPRF: The country or region ID specified in the user profile under which the submitted job runs is used. The user profile is specified on the USER parameter.

country-or-region-ID: Specify the country or region identifier to be used by the job.

CCSID
Specifies the coded character set identifier (CCSID) used for the submitted job.

A CCSID is a 16-bit number identifying a specific set of encoding scheme identifiers, character set identifiers, code page identifiers, and additional coding-related information that uniquely identifies the coded graphic representation used.

*CURRENT: The CCSID specified for the job that is currently running is used.

*USRPRF: The CCSID specified in the user profile under which the submitted job runs is used. The user profile is specified on the USER parameter.

*SYSVAL: The CCSID specified for the system value QCCSID at the time the job is started is used.

*HEX: The CCSID 65535 is used.

coded-character-set-identifier: Specify the CCSID. More information on valid CCSIDs is in the Globalization topic in the Information Center.

SBMFOR
Specifies the job name to be used on the SBMFROM parameter of the WRKSBMJOB command.

*CURRENT: The name of the currently active job is used.

job-number/user-name/job-name: Specify the job number, user name, and job name to be used.

Note: You must have *JOBCTL authority to use this parameter.

JOBMSGQMX
Specifies the maximum size of the job message queue.

*JOBD: The value specified in the job description determines maximum size of the job message queue.

*SYSVAL: The value in QJOBMSGQMX (system value) at the time the job is started is used as the maximum size of the job message queue.

maximum-size-of-job-message-queue: Specify a value in the range of 2 to 64 megabytes.

JOBMSGQFL
Specifies the action that should be taken when the job message queue is full.

*JOBD: The value specified in the job description determines the action that should be taken.

*SYSVAL: The value specified for the QJOBMSGQFL system value is used.

*NOWRAP: The message queue does not wrap when it is full. This action ends the job.

*WRAP: The message queue wraps to the start of the message queue when it is full and starts filling the message queue again.

*PRTWRAP: The message queue wraps the job message queue when full it is and prints the messages that are being overlaid because of wrapping.

CPYENVVAR
Specifies whether the environment variables from the submitting job are copied to the new job.

*NO: The environment variables are not copied.

*YES: The environment variables are copied.

ALWMLTTHD
Specifies whether or not the job is allowed to run with multiple user threads. This attribute does not prevent the operating system from creating system threads in the job. This attribute is not allowed to be changed after the job is submitted.

*JOBD: The value specified in the job description determines whether or not the job is allowed to run with multiple user threads.

*NO: The job is not allowed to run with multiple user threads.

*YES: The job is allowed to run with multiple user threads.

INLASPGRP
Specifies the initial setting for the auxiliary storage pool (ASP) group name for the initial thread of the submitted job. A thread can use the Set Auxiliary Storage Pool Group (SETASPGRP) command to change its library name space. When an ASP group is associated with a thread, all libraries in the independent ASPs in the ASP group are accessible and objects in those libraries can be referenced using regular library-qualified object name syntax. The libraries in the independent ASPs in the specified ASP group plus the libraries in the system ASP (ASP number 1) and basic user ASPs (ASP numbers 2-32) form the library name space for the thread.

*CURRENT: The ASP group name for the current thread is used for the submitted job.

*JOBD: The initial ASP group name specified in the job description is used for the submitted job.

*NONE: Specifies the initial thread of the submitted job will be started with no ASP group. The library name space will not include libraries from any ASP group. Only the libraries in the system ASP and any basic user ASPs will be in the library name space.

auxiliary-storage-pool-group-name: Specify the name of the ASP group to be set for the initial thread of the submitted job. The ASP group name is the name of the primary ASP device within the ASP group. All libraries from all ASPs in this ASP group will be included in the library name space.

SPLFACN
Specifies whether or not spooled files are accessed through job interfaces after the job ends. Keeping spooled files with jobs allows job commands such as Work with Submitted Jobs (WRKSBMJOB) to work with the spooled files even after the job has ended. Detaching spooled files from jobs reduces the use of system resources by allowing job structures to be recycled when the jobs end.

*CURRENT: The value from the current job is used for the submitted job.

*JOBD: The value in the job description is used.

*SYSVAL: The value specified in the system value QSPLFACN is used.

*KEEP: When the job ends, the spooled files are kept with the job and the status of the job is updated to indicate that the job has completed.

*DETACH: When the job ends, the spooled files are detached from the job and the job is removed from the system.End of change

Examples for SBMJOB

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.

Error messages for SBMJOB

*ESCAPE Messages

CPF133A
SBMJOB not allowed during IPL.
CPF1338
Errors occurred on SBMJOB command.
CPF1651
Sort sequence table not accessed.