Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Method

&pagelevel(4)&pagelevel
  • Declare S variable

    The user declares a list variable of the type ’structure’. The structure should be dynamically expandable (default).

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

    If, on the other hand, the structure is created statically, the user can receive only specific information for which he/she has explicitly declared structure elements with the defined names

  • Create structured output

    EXECUTE-CMD command

    For structured output of a single command, the user calls a SHOW command via the EXECUTE-CMD command, specifying that the structured system output is to be routed to the declared S variable.

    /EXECUTE-CMD CMD =( SHOW-SYNTAX-VERSIONS SOFTWARE-UNIT-NAME=(JV, LMS) ), -
    
                 /STRUCTURED-OUTPUT = USERVAR ,TEXT-OUTPUT = *NONE

    Specification of TEXT-OUTPUT=*NONE suppresses output to SYSOUT.
    If output is directed to a variable with a static structure, only already existing elements of the structure are assigned a value. If there is no value for an element, it is assigned a default value that depends on its type:

    INTEGER: 0
    STRING:  '' (null string)
    BOOLEAN: FALSE
    

    If none of the existing element names match any of the defined names, no values are assigned; no error message or warning is returned. In this case, the variable is empty after execution of EXECUTE-CMD if WRITE-MODE=*REPLACE was specified in the DECLARE-VARIABLE command (because of an implicit FREE-VARIABLE prior to command execution).

    The MSG-STRUCTURE-OUTPUT can be used to specify that guaranteed messages for the specified commands are to be output to an S variable. 

    Since the EXECUTE-CMD command temporarily overwrites the assignments for SYSINF and SYSMSG made in the ASSIGN-STREAM command, there is no parallel output to the server specified in ASSIGN-STREAM.

    ASSIGN-STREAM command

    ASSIGN-STREAM serves to assign the S variable streams SYSINF, SYSMSG or SYSVAR to the declared variable. Structured output from SHOW commands is directed to SYSINF, guaranteed messages are directed to SYSMSG. While the assignment is in effect, the S variable is extended dynamically for each command that is issued and supports structured output. The assignment remains in effect until it is explicitly cancelled or until the procedure terminates.

  • Output contents of the S variable

    /SHOW-VARIABLE USERVAR

    Explanation of the output:

    The user-defined S variable (USERVAR) contains the entire output. The string “#i” shows the number of the corresponding list element (LIST-INDEX-NUMBER=*YES was specified in the SHOW-VARIABLE command). The S variable USERVAR contains 2 elements:
    One is the structure for information concerning the software unit JV (marked with (1) in the output), the other is the structure for information concerning the software unit LMS (marked with (2) in the output).
    The information concerning a software unit consists of the elements F-NAME, TYPE and SW-UNIT, where SW-UNIT can again contain a list. In the case of software unit JV, SW-UNIT contains a list element, namely the structure built by the elements NAME, VERSION and COMPONENT (marked with (3) in the output).

    COMPONENT can again be a list: since software unit JV consists of 2 components, COMPONENT contains 2 list elements. Each list element is a structure with the elements NAME and VERSION. The components CJC and JVS are marked with (4) and (5) in the output.

  • Access specific information

    Specific information can be accessed via the names of the S variables. The names must be specified in the following format:

    uservar#i.element

    where:



    uservarName of the structure declared by the user

    #ii-th element in the list
    For i=1, “i” can be omitted, i.e. only “#” is specified.

    periodDelimiter in names of complex S variables.

    elementPredefined name of the structure element.
    element can again be a complex variable:
    e.g. uservar#.SW-UNIT#.NAME

    The contents can be displayed, e.g. with “SHOW-VARIABLE uservar#.element”, or used for further processing via variable replacement: