I don’t want to run a job interactively to engage my session, doing nothing and being stuck until the interactive job is finished. Which might take a long to complete. ? Therefore, I want to submit a job in batch that does not involve my session and even run when my session ends and can check it later once it completes. How to submit a batch job
in as400?
SBMJOB
command is used to submit a job in as400; moreover, an existing job can submit another job to a batch job queue (JOBQ
) to be executed as a batch job at a later time by using the Submit Job (SBMJOB
) command. To launch a program, we need to provide the JOB description (JOBD
), theCL command or request data
, and therouting data
. Also, use theCMD option
onSBMJOB
toexecute a single CL command in a batch job
. It also performssyntax checkin
g and permitsprompting
. Submit a job: Following the command, submit a job.SBMJOB CMD(CALL PGM(PGM1))
JOB(USERJOB)
JOBD(TESTLIB/TESTJOBD)
JOBQ(*JOBD)
OUTQ(TESTOUTQ)
MSGQ(TESTMSGQ)
The
job description
(JOBD) namedTESTJOBD
in the libraryTESTLIB
would provide the majority of the job’s properties.TESTOUTQ
would also be used as theoutput queue
(OUTQ) andTESTMSGQ
as themessage queue
(MSGQ) for the batch job namedUSERJOB
. The command above submits a job. The job will be added to the JOBDs job queue.Submit a job to a job queue: The job is submitted to the
QBATCH
job queue.SBMJOB CMD(CALL PGM(PGM1))
JOB(USERJOB)
JOBD(TESTLIB/TESTJOBD)
JOBQ(QBATCH)
OUTQ(TESTOUTQ)
MSGQ(TESTMSGQ)
How do I release a batch job held on the IBM i machine in a batch job queue?
To release a batch job in as400, use the command
RLSJOB
. This command releases a job from the held state. Please note that releasing a job will automatically release all its related threads.