Script Function: Returns the number of all activated objects
SYS_ACTIVE_COUNT(Status, Object Type, [Object], [Group], [Host])
Syntax |
Description/Format |
---|---|
Status |
Status of all objects shown in the Activity Window Allowed values: "*", "ANY_ABEND", "BLOCKED", "ANY_ALIVE", "PREPARED" and "RUNNING" "*" = tasks of any status |
Object Type |
Short form of the object type or "*"
for all object types |
The parameters shown below are optional filter criteria. You can use one, two or all of them in any combination. Note that commas must always be set, even if particular parameters are not used. Example: |
|
Object |
Name of an object or filter for several objects Wildcard characters can be used. "*" stands for any character, "?" for exactly one. |
Group |
Name of a group or "*" for all groups |
Host |
Name of an agent or filter for several agents Wildcard characters can be used. "*" stands for any character, "?" for exactly one. |
Return code |
---|
Number of objects listed in the Activity Window |
The function SYS_ACTIVE_COUNT can be used to check the number of objects listed in the Activity Window. Use parameters to limit the search to particular tasks. Filters can be specified for status, object type, object name, group and host. Any combination is possible.
The parameter Host can also be used to handle the parallel execution of a job on a particular computer. Check whether or not a job is active using SYS_ACTIVE_COUNT if a job is processed on a regular basis. You can so avoid that executions overlap. The target host can be specified subsequently using the script statement :PUT_ATT. Source and target host can be specified if file transfers are concerned.
Using the parameter Host is only useful with objects of type "JOBS", "JOBF", "EVNT" or "*". Host filters exclude all other object types as they do not require agents for being processed. Hence, the sample script shown below always supplies "0":
:SET &COUNT# = SYS_ACTIVE_COUNT(ANY_ABEND,JOBP,,,"*")
Keep in mind that it is not checked whether or not the indicated host actually exists.
When filtering active jobs using the parameter "RUNNING", all jobs that have a system return codein the range of 1500 to 1599 are considered.
The following examples count the objects listed in the Activity Window. This includes the number of all blocked and canceled objects as well as the number of all events.
:SET &COUNT# = SYS_ACTIVE_COUNT("BLOCKED", "*")
:SET &COUNT# = SYS_ACTIVE_COUNT(ANY_ABEND, "*")
:SET &COUNT# = SYS_ACTIVE_COUNT("*", EVNT)
This example counts tasks that are registered for a specific group. The string "FILE" must appear in all task names.
:SET &COUNT# = SYS_ACTIVE_COUNT("PREPARED", "*", "*FILE*","GRP7")
The following example retrieves the number of jobs that use agent "UNIX01".
:SET &COUNT# = SYS_ACTIVE_COUNT("*", "JOBS", "*",,"UNIX01")
See also:
Script element | Description |
---|---|
Returns the number of jobs that are registered in groups |
Script Elements - Activate Objects
About Scripts
Script Elements - Alphabetical Listing
Script Elements - Ordered by Function