Child job monitoring on IBM i agents
About this task
When you submit a command on an IBM i agent, the command might start one or more batch jobs. The IBM i agent monitors these batch jobs, which are referred to as child jobs.
When searching and monitoring any child jobs that are started, the IBM i agent uses a high percentage of its processing time.
If you know that your job scheduling does not start any child jobs or you have no interest in monitoring child jobs, you can instruct the IBM i agent to not search and monitor child jobs, and hence improve the performance of the agent.
You can exclude child job monitoring either at the agent level for all the commands or at the job definition level for a single command. If you want child job monitoring only for some specific submitted commands, you can set this option at the job definition level for a single command.
- Exclude child jobs from job monitoring at the agent level
- By default child jobs are monitored. You can exclude child jobs
from job monitoring for all submitted commands by creating the TWS_NOCHILDS system
environment variable using the following IBM i system
command:
ADDENVVAR ENVVAR(TWS_NOCHILDS) LEVEL(*SYS)
If the IBM i agent finds the TWS_NOCHILDS on the IBM i system, it does not monitor child jobs for any submitted command.
- Exclude or include child jobs from job monitoring at the job definition level
- You can exclude or include child jobs from job monitoring for
a specific job by using :NOCHILDS or :CHILDS as
ending tokens of the command string for the specific command.
- If you add the :NOCHILDS end token at the end of the native command you are submitting, the IBM i agent ignores any child jobs that are started by the command.
- If you add the :CHILDS end token at the end of the command you are submitting, the IBM i agent finds and monitors all the child jobs that are started by the command.
The SBMJOB system command, when submitted, always starts a batch job. Do not try to exclude the job monitoring, because if the IBM i agent finds the SBMJOB command in the job definition , it removes and ignores the :CHILDS or :NOCHILDS ending token in the job definition and also ignores the setting of the TWS_NOCHILDS system variable.
Examples
- If the TWS_NOCHILDS system variable is defined
on the IBM i system:
CALL PGM(MYLIB/PAYROLL) :CHILDS
- If the TWS_NOCHILDS system variable is not defined
on the IBM i system:
CALL PGM(MYLIB/PAYROLL)
- If the TWS_NOCHILDS system variable is not defined
on the IBM i system:
CALL PGM(MYLIB/MYSCHEDULE) :NOCHILDS
- If the TWS_NOCHILDS system variable is defined
on the IBM i system:
CALL PGM(MYLIB/MYSCHEDULE)
SBMJOB CMD(CALL PGM(MYLIB/USERPGM)) :NOCHILDS