SYS_STATE_JOB_ACTIVE
Use the SYS_STATE_JOB_ACTIVE script function to check whether a Job is already activated. The script function lets you check whether the Job is in a status with a system return code of lower than 1699, or equal to 1701. For more information, see System Return Codes of Executable Objects.
Note: Do not use this script function to synchronize processes. The check is made when the script function is processed, and returns the current status at the time of processing only. The script function cannot check whether the Job will still be activated at a later time.
Syntax
SYS_STATE_JOB_ACTIVE ([Job])
Parameters
-
SYS_STATE_JOB_ACTIVE
Checks whether a Job is active -
Job
(Optional) Name of the Job
Format:AE name, script literal or script variable
Note: Omit the name of the Job to check the status of the Job that contains the script.
Return Codes
The script function has the following return codes:
- Y
Job is active: the system return code is lower than 1699, or equal to 1701 - N
Job is inactive: the system return code is greater than 1699, but not equal to 1701
Note: When you use the script function to check the status of the Job that contains the script, the system always returns Y.
Example
The following example checks whether a Job that is called MM.END.PROCESSING is currently active. The script assigns the return code to a script variable, so that it can be used for further processing.
:SET &ACTIVE# = SYS_STATE_JOB_ACTIVE(MM.END.PROCESSING)
See also:
seealso