Submit a batch job

Since batch jobs are typically low priority jobs that require a special system environment in which to run (such as running at night) they are placed in batch job queues. In the job queue the batch job receives a run time schedule and a priority. To submit a job to a batch job queue, you use the character-based interface and one of two commands.

Command: Submit Job (SBMJOB)

Command: Submit Database Job (SBMDBJOB)

The difference in these commands is the source of the job:

  • The SBMJOB command submits a job to a batch job queue by specifying a job description and by specifying a CL command or request data, or specifying routing data to run a program. If you want to run a single CL command in a the batch job, use the CMD parameter on SBMJOB, which does syntax checking and allows prompting.
  • The SBMDBJOB command can be used to submit a job to a batch job queue from a database file. For these jobs, the job description comes from the BCHJOB statement in the input stream.
Example: In the following example, the SBMJOB command submits a job named WSYS, using the job description QBATCH, to the job queue QBATCH. The CMD parameter gives the CL command that will run in the job.
SBMJOB JOBD(QBATCH) JOB(WSYS) JOBQ(QBATCH) CMD(WRKSYSSTS)
Note: If you get a message that the job was not submitted, you can display the job log spooled file to find errors. Use the WRKJOB command. Specify the job that was not scheduled, select option 4 for spooled files. Display the job log spooled file to find the errors.
Related concepts
How a batch job starts
The submit job command
Related information
QPRTJOB job