Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Example for output in an S variable

This example illustrates output in S variables as a function of the privileges of the caller. It does not represent a situation lifted from actual practice; it is rather an artificial, simplified example designed specially to show the principles involved.

The following privileges exist:

  • Case  1: The caller has only the privilege STD-PROCESSING

  • Case  2: The caller has the privileges STD-PROCESSING and SUBSYSTEM-MANAGEMENT
    or OPERATING

  • Case  3: The caller does not have the privilege STD-PROCESSING, but does have at least one of the privileges SUBSYSTEM-MANAGEMENT and OPERATING

The following configuration exists:

  • the global nonprivileged subsystem AA V04.6 has the status CREATED; one task is connected (TID=00010054, TSN=0123)

  • the global, privileged subsystem XX V01.0 has the status CREATED: one task is connected (TID=0002006F, TSN=0BFC)

  • the global, privileged subsystem XX V02.0 has the status IN-DELETE: two tasks are connected (TID=00070015, TSN=0CMM and TID=00010057, TSN=00AP)

A compound variable of the type “list” with the name DATA is declared and assigned to the S variable stream SYSINF.

/DECLARE-VARIABLE VAR-NAME=DATA(TYPE=*STRUCTURE),
MULTIPLE-ELEMENTS=*LIST

/ASSIGN-STREAM STREAM-NAME=SYSINF,TO=*VAR(VAR-NAME=DATA)

/SHOW-STREAM-ASSIGNMENT

       STREAM-NAME   = SYSINF
        ASSIGN-LEVEL = 0

        DESTINATION  = *VARIABLE

          VARIABLE-NAME = DATA
               VAR-MODE = *EXTEND

          RETURN-VARIABLE-NAME = *NONE

          CONTROL-VAR-NAME = *NONE
          RET-CONTROL-VAR-NAME = *NONE

    STREAM-NAME   = SYSMSG


Case 1: The caller has only the privilege STD-PROCESSING

/SHOW-SUBSYSTEM-STATUS SUBSYSTEM-NAME=*ALL ————————————————————————————  (1)

% LOCAL SUBSYSTEM AA     /V04.5    IS CREATED

% SUBSYSTEM AA     /V04.6    IS CREATED
/SHOW-VAR DATA ————————————————————————————————————————————————————————  (2)

   :

   DATA(*LIST).SUBSYS-TYPE='*LOC'
   DATA(*LIST).SUBSYS-NAME='AA'

   DATA(*LIST).SUBSYS-VERSION='04.5'

   DATA(*LIST).SUBSYS-STA='*CREATED'
   DATA(*LIST).SUBSYS-TYPE='*GLB'

   DATA(*LIST).SUBSYS-NAME='AA'

   DATA(*LIST).SUBSYS-VERSION='04.6'
   DATA(*LIST).SUBSYS-STA='*CREATED'

/SHOW-SUBSYSTEM-STATUS SUBSYSTEM-NAME=AA ——————————————————————————————  (3)

% LOCAL SUBSYSTEM AA     /V04.5    IS CREATED

% SUBSYSTEM AA      /V04.6    IS CREATED

/SHOW-VAR DATA ————————————————————————————————————————————————————————  (4)
   :

   DATA(*LIST).SUBSYS-TYPE='*LOC'

   DATA(*LIST).SUBSYS-NAME='AA'
   DATA(*LIST).SUBSYS-VERSION='04.5'

   DATA(*LIST).SUBSYS-STA='*CREATED'

   DATA(*LIST).SUBSYS-TYPE='*GLB'
   DATA(*LIST).SUBSYS-NAME='AA'

   DATA(*LIST).SUBSYS-VERSION='04.6'

   DATA(*LIST).SUBSYS-STA='*CREATED'

(1)

The names, versions and statuses of all global, nonprivileged subsystems and of all local subsystems are output to SYSOUT. In our specially constructed example, only the global subsystem AA is nonprivileged. It is output - together with the local subsystem AA.

(2)

Output in the S variable DATA explicitly contains the subsystem type “global” or “local”.

(3)

The restriction concerning output to subsystem AA does not result in any changes in the output to SYSOUT, in contrast to (1).

(4)

The restriction concerning output to subsystem AA does not result in any changes in the output to the S variable DATA in contrast to (2).

Case 2: The caller has the privileges STD-PROCESSING and SUBSYSTEM-MANAGEMENT and/or OPERATING

/SHOW-SUBSYSTEM-STATUS SUBSYSTEM-NAME=*ALL ————————————————————————————  (5)

% LOCAL SUBSYSTEM AA     /V04.5    IS CREATED

% SUBSYSTEM AA     /V04.6    IS CREATED
% SUBSYSTEM XX     /V01.0    IS CREATED

% SUBSYSTEM XX     /V02.0    IS IN DELETE / WAIT-DISCON

/SHOW-VAR DATA ————————————————————————————————————————————————————————  (6)
   :

   DATA(*LIST).SUBSYS-TYPE='*LOC'

   DATA(*LIST).SUBSYS-NAME='AA'
   DATA(*LIST).SUBSYS-VERSION='04.5'

   DATA(*LIST).SUBSYS-STA='*CREATED'

   DATA(*LIST).SUBSYS-TYPE='*GLB'
   DATA(*LIST).SUBSYS-NAME='AA'

   DATA(*LIST).SUBSYS-VERSION='04.6'

   DATA(*LIST).SUBSYS-STA='*CREATED'
   DATA(*LIST).SUBSYS-TYPE='*GLB'

   DATA(*LIST).SUBSYS-NAME='XX'

   DATA(*LIST).SUBSYS-VERSION='01.0'
   DATA(*LIST).SUBSYS-STA='*CREATED'

   DATA(*LIST).SUBSYS-TYPE='*GLB'

   DATA(*LIST).SUBSYS-NAME='XX'

   DATA(*LIST).SUBSYS-VERSION='02.0'
   DATA(*LIST).SUBSYS-STA='*IN-DELETE'

   DATA(*LIST).SUBSYS-INT-STA='WAIT-DISCON'

/SHOW-SUBSYSTEM-STATUS SUBSYSTEM-NAME=AA ——————————————————————————————  (7)
% LOCAL SUBSYSTEM AA     /V04.5    IS CREATED

% SUBSYSTEM AA     /V04.6    IS USED BY 1 TASK

% TASKID 00010054

% TSN        0123

%   4 CONNECTIONS SINCE STARTUP

/SHOW-VAR DATA ————————————————————————————————————————————————————————  (8)
   :

   DATA(*LIST).SUBSYS-TYPE='*LOC'

   DATA(*LIST).SUBSYS-NAME='AA'
   DATA(*LIST).SUBSYS-VERSION='04.5'

   DATA(*LIST).SUBSYS-STA='*CREATED'

   DATA(*LIST).SUBSYS-TYPE='*GLB'
   DATA(*LIST).SUBSYS-NAME='AA'

   DATA(*LIST).SUBSYS-VERSION='04.6'

   DATA(*LIST).SUBSYS-STA='*CREATED'
   DATA(*LIST).CONN-NUM-SINCE-START=4

   DATA(*LIST).USED-TASK-LIST(*LIST).TID='00010054'

   DATA(*LIST).USED-TASK-LIST(*LIST).TSN='0123'

(5)

The names, versions and statuses of all global and local subsystems are output to SYSOUT. In other words, information is provided on all subsystems loaded in the current system. In our specially constructed example, this refers to the global subsystems XX (privileged, two versions) and AA (nonprivileged) and to the local subsystem AA.

(6)

Output in the S variable DATA explicitly contains the subsystem type “global” or “local”.

(7)

The restriction affecting the output to subsystem AA does not result in any changes as compared with (1): any tasks connected to a subsystem are shown together with their TSN and TID. The total number of tasks connected to this subsystem since startup is likewise output to SYSOUT.

(8)

Output from the subsystems AA in the S variable DATA contains the same information as in the output to SYSOUT, as well as additional information concerning the subsystem type “global” or “local”.

Case 3: The caller does not have the privilege STD-PROCESSING but does have one of the privileges SUBSYSTEM-MANAGEMENT or OPERATING

/SHOW-SUBSYSTEM-STATUS SUBSYSTEM-NAME=*ALL ————————————————————————————  (9)
% SUBSYSTEM AA     /V04.6    IS CREATED

% SUBSYSTEM XX     /V01.0    IS CREATED

% SUBSYSTEM XX     /V02.0    IS IN DELETE / WAIT-CLS-CTRL
/SHOW-VAR DATA ———————————————————————————————————————————————————————— (10)

   :

   DATA(*LIST).SUBSYS-TYPE='*GLB'
   DATA(*LIST).SUBSYS-NAME='AA'

   DATA(*LIST).SUBSYS-VERSION='04.6'

   DATA(*LIST).SUBSYS-STA='*CREATED'
   DATA(*LIST).SUBSYS-TYPE='*GLB'

   DATA(*LIST).SUBSYS-NAME='XX'

   DATA(*LIST).SUBSYS-VERSION='01.0'
   DATA(*LIST).SUBSYS-STA='*CREATED'

   DATA(*LIST).SUBSYS-TYPE='*GLB'

   DATA(*LIST).SUBSYS-NAME='XX'
   DATA(*LIST).SUBSYS-VERSION='02.0'

   DATA(*LIST).SUBSYS-STA='*IN-DELETE'

   DATA(*LIST).SUBSYS-INT-STA='WAIT-CLS-CTRL'

/SHOW-SUBSYSTEM-STATUS SUBSYSTEM-NAME=XX —————————————————————————————— (11)

% SUBSYSTEM XX     /V0.0    IS USED BY 1 TASK

% TASKID 0002006F

% TSN        0BFC

%   7 CONNECTIONS SINCE STARTUP

% SUBSYSTEM XX     /V02.0    IS USED BY 2 TASKS
% TASKID 00070015 00010057

% TSN        0CMM     0OAP

%                         IS IN DELETE / WAIT-DISCON
% 12 CONNECTIONS SINCE STARTUP

/SHOW-VAR DATA ———————————————————————————————————————————————————————— (12)

   :
   DATA(*LIST).SUBSYS-TYPE='*GLB'

   DATA(*LIST).SUBSYS-NAME='XX'

   DATA(*LIST).SUBSYS-VERSION='01.0'
   DATA(*LIST).SUBSYS-STA='*CREATED'

   DATA(*LIST).CONN-NUM-SINCE-START=7

   DATA(*LIST).USED-TASK-LIST(1).TID='0002006F'
   DATA(*LIST).USED-TASK-LIST(1).TSN='0BFC'

   DATA(*LIST).SUBSYS-TYPE='*GLB'

   DATA(*LIST).SUBSYS-NAME='XX'

   DATA(*LIST).SUBSYS-VERSION='02.0'
   DATA(*LIST).SUBSYS-STA='*IN-DELETE'

   DATA(*LIST).SUBSYS-INT-STA='WAIT-DISCON'

   DATA(*LIST).CONN-NUM-SINCE-START=12
   DATA(*LIST).USED-TASK-LIST(*LIST).TID='00070015'

   DATA(*LIST).USED-TASK-LIST(*LIST).TSN='0CMM'

   DATA(*LIST).USED-TASK-LIST(*LIST).TID='00010057'
   DATA(*LIST).USED-TASK-LIST(*LIST).TSN='0OAP'

(9)

The names, versions and statuses of all global subsystems are output to SYSOUT. In our specially constructed example, this refers to the global subsystems XX (privileged, two versions) and AA (nonprivileged).

(10)

Output in the S variable DATA contains the same information as in output to SYSOUT.

(11)

The restriction concerning output to the subsystem XX produces the following changes as compared with (9): any tasks connected to a subsystem are displayed with their TSN and TID. The total number of tasks connected to this subsystem since startup is likewise output to SYSOUT.

(12)

Output from the subsystems XX in the S variable DATA contains the same information as in output to SYSOUT, with the addition of information concerning the subsystem type “global”.