Submitting 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)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.
- Using an inline data file
An inline data file is a data file that is included as part of a batch job when the job is read by a reader or a submit jobs command. You use SBMDBJOB or STRDBRDR to queue up a CL batch stream (stream of CL commands to be executed or run). That CL batch stream can include data to be placed into "temporary" files (inline files). When the job ends, the inline files are deleted.- Considerations for opening inline data files
You need to consider these elements when you open inline date files.
Parent topic:
Managing batch jobsRelated concepts
How a batch job starts The submit job commandRelated information
QPRTJOB job