The ASSIGN-STREAM
or EXECUTE-CMD
commands allow to specify that you require structured output in an S variable.
For further information on these commands refer to the “SDF-P” manual [34].
ASSIGN-STREAM
You use ASSIGN-STREAM
to request structured output to an S variable for all subsequent commands. As long as this assignment remains in force, the S variable will be added to accordingly for each SHOW command that is issued which supports structured output in S variables.
Example
The S variable OUT
is declared as described above. The SHOW-STREAM-ASSIGNMENT
command is then used to display the current assignments of the SYSINF, SYSMSG and SYSVAR S variable streams. SYSINF and SYSMSG are by default assigned to SYSVAR; the assignment of SYSVAR is *DUMMY, which means that neither command output nor guaranteed messages are assigned to an S variable stream.
/SHOW-STREAM-ASSIGNMENT
Output to SYSOUT
STREAM-NAME = SYSINF ASSIGN-LEVEL = 0 DESTINATION = SYSVAR STREAM-NAME = SYSMSG ASSIGN-LEVEL = 0 DESTINATION = SYSVAR STREAM-NAME = SYSVAR ASSIGN-LEVEL = 0 DESTINATION = *DUMMY
The ASSIGN-STREAM
command specifies that structured command output is to be routed via the SYSINF S variable stream and written to S variable OUT
.
/ASSIGN-STREAM STREAM-NAME=SYSINF,TO=*VAR(VAR-NAME=OUT)
The SHOW-STREAM-ASSIGNMENT
command can now be used to display the current assignment of SYSINF. This command also supports structured output in S variables, so its output is already being written to the VAR
S variable.
/SHOW-STREAM-ASSIGNMENT
Output to SYSOUT
STREAM-NAME = SYSINF ASSIGN-LEVEL = 0 DESTINATION = *VARIABLE VARIABLE-NAME = OUT VAR-MODE = *EXTEND RETURN-VARIABLE-NAME = *NONE CONTROL-VAR-NAME = *NONE RET-CONTROL-VAR-NAME = *NONE STREAM-NAME = SYSMSG ASSIGN-LEVEL = 0 DESTINATION = SYSVAR STREAM-NAME = SYSVAR ASSIGN-LEVEL = 0 DESTINATION = *DUMMY
The SHOW-FILE-ATTRIBUTES
command likewise supports structured output in S variables. The information on storage space usage is output separately for public and private volumes. The data is written to OUT
as an additional list element.
/SHOW-FILE-ATTRIBUTES *ALL,INF=*SPACE-SUM
Output to SYSOUT
%:2OSG: PUBLIC: 396 FILES RES= 9006 FRE= 1805 REL= 867 PAGES %:2OSG: PUB/S2: 50 FILES RES= 10872 FRE= 1936 REL= 1867 PAGES
The contents of OUT
are displayed with the SHOW-VARIABLE
command.
/show-var out,inf=*par(list-index-number=*yes)
OUT#1.STREAM-NAME = SYSINF <------structured output of SHOW-STREAM-ASSIGNMENT OUT#1.ASS-LEV = 0 OUT#1.SERVER-NAME = OUT#1.SERVER-INFO = OUT#1.VAR-NAME = OUT OUT#1.VAR-MODE = *EXT OUT#1.RET-VAR-NAME = *NONE OUT#1.RET-VAR-MODE = OUT#1.CONTR-VAR-NAME = *NONE OUT#1.CONTR-VAR-MODE = OUT#1.RET-CONTR-VAR-NAME = *NONE OUT#1.RET-CONTR-VAR-MODE = OUT#1.DEST = *VAR OUT#2.STREAM-NAME = SYSMSG OUT#2.ASS-LEV = 0 OUT#2.SERVER-NAME = OUT#2.SERVER-INFO = OUT#2.VAR-NAME = OUT#2.VAR-MODE = OUT#2.RET-VAR-NAME = OUT#2.RET-VAR-MODE = OUT#2.CONTR-VAR-NAME = OUT#2.CONTR-VAR-MODE = OUT#2.RET-CONTR-VAR-NAME = OUT#2.RET-CONTR-VAR-MODE = OUT#2.DEST = SYSVAR OUT#3.STREAM-NAME = SYSVAR OUT#3.ASS-LEV = 0 OUT#3.SERVER-NAME = OUT#3.SERVER-INFO = OUT#3.VAR-NAME = OUT#3.VAR-MODE = OUT#3.RET-VAR-NAME = OUT#3.RET-VAR-MODE = OUT#3.CONTR-VAR-NAME = OUT#3.CONTR-VAR-MODE = OUT#3.RET-CONTR-VAR-NAME = OUT#3.RET-CONTR-VAR-MODE = OUT#3.DEST = *DUMMY OUT#4.PUBSET-ID = 2OSG <------structured output of SHOW-FILE-ATTRIBUTES OUT#4.PUBSET.NUM-OF-F = 396 OUT#4.PUBSET.REL = 867 OUT#4.PUBSET.RESERVED = 9006 OUT#4.PUBSET.FREE = 1805 OUT#4.MIGRATE-S1.NUM-OF-F = 0 OUT#4.MIGRATE-S1.REL = 0 OUT#4.MIGRATE-S1.RESERVED = 0 OUT#4.MIGRATE-S1.FREE = 0 OUT#4.MIGRATE-S2.NUM-OF-F = 50 OUT#4.MIGRATE-S2.REL = 1867 OUT#4.MIGRATE-S2.RESERVED = 10872 OUT#4.MIGRATE-S2.FREE = 1936 OUT#4.PRIV.NUM-OF-F = 0 OUT#4.PRIV.REL = 0 OUT#4.PRIV.RESERVED = 0 OUT#4.PRIV.FREE = 0 OUT#4.TAPE.NUM-OF-F = 0
Next the command ASSIGN-STREAM SYSINF,TO=*STD
is used to re-assign the S variable stream to its default setting. This terminates structured output to S variable OUT
.
EXECUTE-CMD
To restrict structured output to a single command you use the EXECUTE-CMD
command to invoke a SHOW command, specifying that the structured output is to be passed to the S variable OUT
that you have already declared (see section "Declaring S variables").
/EXECUTE-CMD CMD=(SHOW-USER-ATTR INF=*ATTR), STRUCTURE-OUTPUT=OUT,
TEXT-OUTPUT=*NONE
TEXT-OUTPUT=*NONE
suppresses output to SYSOUT.