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_NOCHILDSsystem environment variable using the following IBM i system command:ADDENVVAR ENVVAR(TWS_NOCHILDS) LEVEL(*SYS)If the IBM i agent finds the TWS_NOCHILDSon 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 :NOCHILDSor:CHILDSas ending tokens of the command string for the specific command.- If you add the :NOCHILDSend 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 :CHILDSend 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.
 
- If you add the 
Examples
PAYROLL program is run, define
the following command in the job definition:  - If the TWS_NOCHILDSsystem variable is defined on the IBM i system:CALL PGM(MYLIB/PAYROLL) :CHILDS
- If the TWS_NOCHILDSsystem variable is not defined on the IBM i system:CALL PGM(MYLIB/PAYROLL)
MYSCHEDULE program
is run, define the following command in the job definition:  - If the TWS_NOCHILDSsystem variable is not defined on the IBM i system:CALL PGM(MYLIB/MYSCHEDULE) :NOCHILDS
- If the TWS_NOCHILDSsystem variable is defined on the IBM i system:CALL PGM(MYLIB/MYSCHEDULE)