Scheduling and monitoring jobs on IBM i systems
About this task
When scheduling a job on IBM i systems, the job launches a native command that can be either a system or a user command. For example, the native command might consist of SBMJOB system command, which launches a batch job. The native command can starts one or more IBM i programs. The IBM i programs can be monitored only if they are started by the native command.
You can specify the name of the queue where the monitoring agent component runs by using the MonitorQueueName property in the native job launcher section of the JobManager.ini file. If you do not specify this property, the default queue (QBATCH) is used.
For more information, see Configuring properties of the native job launcher [NativeJobLauncher].
IBM i programs might generate runtime
inquiry messages that require a reply before the program can continue to run. While monitoring
IBM i jobs, IBM Workload Scheduler operators have to check the IBM i console to find inquiry messages waiting
for a reply. IBM Workload Scheduler provides a set of
useful features that help operators detecting and replying to inquiry messages.
- Check of inquiry messages waiting for a reply
You can use the Dynamic Workload Console and conman showjobs command line to check whether an IBM i job is waiting for a reply to a message. An IBM i job that is waiting for a message reply is in the SUSP (suspended) status. This status indicates that the job is waiting for input while running. When the input is received, the job status changes to EXEC (executing).
For more information about job statuses, see Status description and mapping for distributed jobs.
- Direct reply to inquiry messages from the Dynamic Workload Console
- When an IBM i job is waiting for a reply to a message, you can reply to the message directly from the Monitor Workload of the Dynamic Workload Console. The job in SUSP (suspended) status requires your attention on additional information to be displayed. Click on the hyperlink. A pop-up window shows the message that is waiting for your reply. Reply to the message in the pop-up window, then select one of the following actions:
- Forward action
- To forward your reply. A message in the pop-up window confirms that your reply was sent successfully.
- Cancel action
- To cancel your reply. The pop-up window is closed.
Note: For a correct display of the pop-up window that shows the message waiting for your reply, your master domain manager must be at version 9.3.0.2. Monitoring and reply to messages for IBM i child jobs
While you are monitoring a parent job from the Dynamic Workload Console, you can monitor also the child jobs for that parent job. When the parent job is in SUSP (suspended) status, you can reply to messages for the parent job and also for the child jobs.
- Automated reply to inquiry messages
- For the most frequent inquiry messages, you can even define standard rules to automate the reply to the waiting messages. When defining an IBM i job, by using the Workload Designer of the Dynamic Workload Console or the composer command line, specify the list of messages for which you want to set up an automated reply. For each message, specify:
- Message Id
- The message identifier.
- Message Text
- The message text.
- Message Reply
- The automated reply that you want to define.
Message Max Replies
The maximum number of automated replies accepted for this specific message. Valid range is from 0 to 100. Default value is 10. If 0 is specified, the automated reply to the message is disabled.
This parameter optimizes the management of IBM i inquiry messages. For example, when you set a wrong reply to a message in the job definition, IBM i system keeps on sending out the same inquiry message repeatedly while waiting for the a correct reply. To avoid this issue, IBM Workload Scheduler has the capability to intercept and disable the wrong automatic reply and require, with a prompt, a direct reply from the Dynamic Workload Console. The job remains in SUSP (suspended) status until the correct reply is provided.
For more information about how to define IBM i jobs, see: IBM i jobs.
- Logging of inquiry messages
If an IBM i job generates inquiry messages, the messages and the related replies are written into the correspondent IBM Workload Scheduler output job log so that the IBM Workload Scheduler operator can keep track of them.
Reliable monitoring of IBM i job status changes
As an inquiry message receives an automated reply, the IBM i job status changes from SUSP (suspended) to EXEC (executing) and vice versa. All the job status changes are monitored and tracked. This is useful, for example, when you want to create an event rule definition to send an email every time a job status change occurs.
Improved trace facilities
- To track an IBM i job, run the following steps:
- Activate the trace facilities on the IBM i system, by running the following
commands:
where trace_level indicates the tracking level and can have one of the following values:ADDENVVAR ENVVAR(DMON_TRACE_ENABLED) VALUE('true') LEVEL(*SYS) ADDENVVAR ENVVAR(DMON_TRACE_LEVEL) VALUE('trace_level') LEVEL(*SYS)
- 1: DEBUG MIN
- 2: DEBUD MID
- 3: DEBUG MAX
- Customize your IBM i agent, by
properly setting the following configuration parameters in the ITA section of JobManager.ini file,
for example:
where trace_level indicates the tracking level and must have the same value already set on the IBM i system.DMON_TRACE_ENABLED = true DMON_TRACE_LEVEL = trace_level
- Analyze the trace file native.outTR that you can find in the compressed
file named with the job ID in the following
path:
TWA_home/TWS/stdlist/JM/yyyy.mm.dd/archive
- Activate the trace facilities on the IBM i system, by running the following
commands: