SYS_ACTIVE_COUNT
Use the SYS_ACTIVE_COUNT script function to return the number of activated tasks currently listed in the Process Monitoring perspective. You can limit the results by specifying status, object type, object name, group, host, or a combination of these filters.
Tip: Use the Host parameter to check whether a regularly processed job is currently active, to help avoid overlapping executions. You can then use :PUT_ATT to specify the target host, or the source and target host for File Transfer jobs. For more information, see :PUT_ATT.
Syntax
SYS_ACTIVE_COUNT (Status, Object Type [, Object] [, Group] [, Host])
Parameters
| Parameter | Description | Format | Allowed Values |
|---|---|---|---|
| Status | Filters by task status. For more information, see Task Status. | AE name, script literal, or script variable | ANY_ABEND — Canceled tasks ANY_ALIVE — Tasks in a group that are neither canceled nor finished BLOCKED — Blocked tasks PREPARED — Tasks registered in a Job Group RUNNING — Active jobs. * — Any status |
| Object Type | Short name of the object type. Use * to include all object types. | AE name, script literal, or script variable | n.a. |
| Object
(Optional) |
Name of one or more objects. Wildcard characters * (any number of characters) and ? (single character) are supported. | AE name, script literal, or script variable | n.a. |
| Group
(Optional) |
Name of a Job Group. Use * to include all Job Groups. | AE name, script literal, or script variable | n.a. |
| Host
(Optional) |
Name of one or more agents. Wildcard characters * and ? are supported. When an agent is specified, all object types that do not require an agent are excluded from the results. Important! The system does not check whether the specified agent actually exists. |
AE name, script literal, or script variable | n.a. |
Important Considerations
-
You can use one, two, or all optional parameters in any combination.
-
Include all commas even when omitting optional parameters. For example: : SET &COUNT# = SYS_ACTIVE_COUNT ("*", JOBS,, "MM.GROUP")
Examples
The following examples return the number of activated tasks in the Process Monitoring perspective using different filter combinations.
Number of all blocked tasks:
: SET &COUNT# = SYS_ACTIVE_COUNT ("BLOCKED", "*")
Number of all canceled tasks:
: SET &COUNT# = SYS_ACTIVE_COUNT (ANY_ABEND, "*")
Number of active Events:
: SET &COUNT# = SYS_ACTIVE_COUNT ("*", EVNT)
The following example counts tasks registered for a specific group whose names contain the string FILE.
: SET &COUNT# = SYS_ACTIVE_COUNT ("PREPARED", "*", "*FILE*", "GRP7")
The following example retrieves the number of jobs using agent UNIX01.
: SET &COUNT# = SYS_ACTIVE_COUNT ("*", "JOBS", "*",, "UNIX01")