SYS_STATE_ACTIVE
Use the SYS_STATE_ACTIVE script function to check whether a task is already activated.
Notes:
- 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 task will still be activated at a later time.
- The task must belong to the class of executable objects.
Syntax
SYS_STATE_ACTIVE ([[Object type,] Object name])
Parameters
-
SYS_STATE_ACTIVE
Checks whether a task is active -
Object type
(Optional) Short name of the executable object type
Format: AE name, script literal or script variable -
Object name
(Optional) Name of the task
Format: AE name, script literal or script variable
Note: Omit both the object type and the object name to check the status of the task that contains the script.
Return Codes
The script function has the following return codes:
- Y
Task is active - N
Task is inactive
Note: When you use the script function to check the status of the task that contains the script, the system always returns Y.
Examples
The following example tests if the task that contains the script has already been activated.
:SET &ACTIVE# = SYS_STATE_ACTIVE()
The following example uses the script function to define a condition.
:IF SYS_STATE_ACTIVE(JOBS, "MM.END.PROCESSING") = "Y"
!...
:ENDIF
See also:
seealso