HCL Workload Automation, Version 9.4

Normal and extended modes

About this task

You define and schedule IBM i jobs at the HCL Workload Automation master domain manager level using the command-line interface and the generic syntax that is valid for any fault-tolerant agent processor. For example:
AS4CPU#AS4JOBNAME DOCOMMAND "command-string"
   STREAMLOGON "OS400 User Profile"
   DESCRIPTION "Test Description"
   RECOVERY STOP
where:
AS4CPU
Is an IBM i processor defined in the HCL Workload Automation topology.
AS4JOBNAME
Is the name of the job.
command-string
Is a generic string consisting of a single IBM i user or system command.
OS400 User Profile
Is an existing user profile.
The following sample shows a job definition for the TWAS processor:
TWAS#TEST_001 DOCOMMAND "WRKOUTQ OUTPUT(*PRINT)"
   STREAMLOGON "MINERMA"
   DESCRIPTION "Test N.1"
   RECOVERY STOP

When the TEST_001 job is submitted, it runs as a batch job on the IBM i processor in the same way as a user (logged into the system with user profile MINERMA) who entered the "WRKOUTQ OUTPUT(*PRINT)" command. This behavior is induced by the STREAMLOGON keyword with some limitations. For more information, see Library list setting for IBM i jobs.

The IBM i agent runs the command found in "command-string" in one of the following modes:
normal mode
If the first token of "command-string" is not "SUBMIT:", the command is run in normal mode. See the job definition sample above where the WRKOUTQ command is run in normal mode. Normal mode can run and monitor any system and user command. In normal mode, for any submitted command, a dedicated IBM i agent job is started, with job name MONPROC and job user QMAESTRO. The submitted command is run and monitored until completion under the MONPROC job.

Do not use normal mode to run the SBMJOB system command. If "command-string" is SBMJOB, the command is run, but the monitoring is limited to the completion of the command and the job generated by SBMJOB is not monitored.

Use normal mode if you want to capture return codes from your jobs. The IBM i agent supplies a JOBMANRC user exit that allows you to manage return codes when normal mode is used. For details, see Controlling the job environment with JOBMANRC.

extended mode
If the first token of "command-string" is "SUBMIT:", the command is run in extended mode. To define a command to run in extended mode, set "command-string" to the SBMJOB command that must be submitted to run the same command on IBM i inside a new batch job. Use as many parameters as needed for SBMJOB, and then substitute SBMJOB with “SUBMIT:".

Not all the SBMJOB parameters are allowed in setting “command-string.” For more information, see Controlling jobs in extended mode.

Extended mode is not limited to monitoring a simple command but instead an IBM i job, meaning the SBMJOB system command. A dedicated MONPROC monitor job is started to run the SBMJOB command set in “command-string.” The monitor job waits until the completion of the related IBM i job, when MONPROC retrieves the system completion message and any related IBM i spool files. Depending on the completion message found into its dedicated QCOMPLETE message queue, the IBM i agent sets the ended job as abended or successfully. At this time, a report for the job is created in the stdlist directory of the IBM i agent, specifically the /maestro/stdlist stream directory, where the spool files are also included. Information about how to include or exclude the spool files is described in the following sections.

The following sample shows a job definition related to a job run in extended mode for the TWAS processor:
TWAS#TEST_002 DOCOMMAND "SUBMIT: CMD(WRKOUTQ OUTPUT(*PRINT)) 
JOB(MYJOB) USER(PEPPE)"
STREAMLOGON "MINERMA"
DESCRIPTION "Test N.2"
RECOVERY STOP
In this sample, the same system command of the previous sample, WRKOUTQ, is coded to run in extended mode. This means that the WRKOUTQ command is run inside a job with the job name MYJOB and the user name PEPPE. In the normal mode sample, the same command is run inside a job with job name MONPROC and user name QMAESTRO. In the SBMJOB command, if you omit the JOB or the USER parameter or both, the IBM i job inside of which the WRKOUTQ command is contained, runs with the job name TEST_002 and the job user MINERMA by default.
In both modes, the IBM i agent generates a job report. In extended mode only, the job report also includes an IBM i job log, if one was generated for the job.