$Subsys

From m204wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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 * . . .