Submit Job (SBMJOB) in AS400 |
SBMJOB
The Submit Job (SBMJOB) command allows an already running job to submit another job to a batch job queue (JOBQ) to be run later as a batch job
We need to specify JOB description (JOBD), CL command or request data, routing data to run a program.
To run single CL command in a batch job using the CMD parameter on SBMJOB and it also does syntax checking and allows prompting.
Submitting a Batch Job
Below command submits the batch job named TESTJOB, Most of the attributes of the job would be taken from the Job description (JOBD) named EASYCLASS in library EASYCLASS1, Output queue (OUTQ) used would be EASYCLASS, and message queue (MSGQ) used would be EASYCLASS.
The Job will be submitted to the JOBDs job queue and JOBDs associated with JOBQ is EASYCLASS.
SBMJOB CMD(CALL PGM(TESTPGM1)) JOB(TESTJOB) JOBD(EASYCLASS1/EASYCLASS) JOBQ(*JOBD) OUTQ(EASYCLASS) MSGQ(EASYCLASS)
DSPJOBD EASYCLASS
Display Job Description Syst Job description: EASYCLASS Library: QGPL User profile . . . . . . . . . . . . . . . . . . : *RQD CL syntax check . . . . . . . . . . . . . . . . : 20 Hold on job queue . . . . . . . . . . . . . . . : *NO End severity . . . . . . . . . . . . . . . . . . : 30 Job date . . . . . . . . . . . . . . . . . . . . : *SYSVAL Job switches . . . . . . . . . . . . . . . . . . : 00000000 Inquiry message reply . . . . . . . . . . . . . : *RQD Job priority (on job queue) . . . . . . . . . . : 5 Job queue . . . . . . . . . . . . . . . . . . . : EASYCLASS Library . . . . . . . . . . . . . . . . . . . : QGPL Output priority (on output queue) . . . . . . . : 5 Printer device . . . . . . . . . . . . . . . . . : *USRPRF Output queue . . . . . . . . . . . . . . . . . . : *USRPRF Library . . . . . . . . . . . . . . . . . . . :
Submitting a Batch Job to a Job Queue (JOBQ)
The below command submits the batch job named TESTJOB to a Job queue named EASYCLASS.
SBMJOB CMD(CALL PGM(TESTPGM1)) JOB(TESTJOB) JOBD(EASYCLASS1/EASYCLASS) JOBQ(EASYCLASS) OUTQ(EASYCLASS) MSGQ(EASYCLASS)
Related Post
- AS400 Jobs
- Work with Job (WRKJOB) in AS400
- Work with Spooled Files (WRKSPLF) in AS400
- How does a batch job start in AS400
- Job Log in AS400
- Work with Active Jobs (WRKACTJOB) in AS400
- Work with User Jobs (WRKUSRJOB) in AS400
- Work with Submitted Jobs (WRKSBMJOB) in AS400
- HLDJOB, RLSJOB and ENDJOB in AS400
- Display Job Log (DSPJOBLOG) in AS400
- Job Status in AS400
- Sign Off (SIGNOFF) in AS400