$Subsys

From m204wiki
Revision as of 19:26, 29 July 2014 by Mlarocca (talk | contribs) (Mlarocca moved page $SUBSYS to $Subsys: Lower case change)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Function

The $SUBSYS function determines the status of a subsystem. This function typically is used when designing applications through the Subsystem Management facility. You can use $SUBSYS to determine whether a subsystem is active before transferring control from one subsystem to another.

Syntax

$SUBSYS(subsystemname)

$SUBSYS takes a subsystem name as an argument and returns a value indicating the status of that subsystem

Value The subsystem is...
0 Not active (not started)
1 Active (started)
2 Draining (the STOP command has been issued and users are in the subsystem).
3 In test mode.
4 Draining (because a SUSPEND command was issued)
5 Suspended

The $SUBSYS function without an argument returns the name of the subsystem you are currently in. For example, the User Language statement:

%CURSYS = $SUBSYS

assigns the name of the current subsystem to %CURSYS, if executed within a subsystem, or returns null if at command level.

Example

. . . TRANSFER: IF $SUBSYS('AUTOS') = 1 THEN . * * TRANSFER TO INSURANCE SUBSYSTEM * . . .