Domain: PROCEDURE
Command description
Output medium: SYSOUT / SYSLST / file / list variable / library element
Output format:
The contents of variables of data type
INTEGER
are output as strings of the numerics 0-9, possibly prefixed by a minus sign.The contents of variables of data type
BOOLEAN
are output as either of the strings FALSE orTRUE
.
With structure-type complex variables, the contents of the variable elements are output in the order of element declarations, with array-type complex variables, the contents of the variable elements are output in the numeric order of the array indices. A new output line is started for each variable.
Format
SHOW-VARIABLE |
VARIABLE-NAME = *ALL / *LIST(...) / list-poss(2000): <composed-name 1..255> /<structured-name 1..20 with-wild(40)> *LIST(...) LIST-NAME = <composed-name 1..255> ,FROM-INDEX = *FIRST / *LAST / <integer 1..2147483647> ,NUMBER-OF-ELEMENTS = 1 / *REST / <integer 1..2147483647> ,SELECT = *BY-ATTRIBUTES(...) *BY-ATTRIBUTES(...) SCOPE = *VISIBLE / *PROCEDURE / *CURRENT / *CURRENT-PARAMETERS / *TASK-VISIBLE / *TASK-ALL / *CALLING-PROCEDURES ,INITIALIZATION = *YES / *ANY ,INFORMATION = *PARAMETERS(...) *PARAMETERS(...) VALUE = *WITHOUT-QUOTES / *C-LITERAL / *X-LITERAL / *NONE ,NAME = *FULL-NAME (...) / *ELEMENT-NAME (...) / *NONE *FULL-NAME(...) LIST-INDEX-NUMBER = *NO / *YES *ELEMENT-NAME(..) LIST-INDEX-NUMBER = *NO / *YES ,OUTPUT = *SYSOUT / *SYSLST / <filename 1..54 without-gen-vers>(...) / *VARIABLE(...) / *LIBRARY-ELEMENT(...) <filename 1..54 without-gen-vers>(...) WRITE-MODE (SELECT-VARIABLE-ELEMENTS Select elements from list variable ) = *REPLACE / *EXTEND *VARIABLE(...) VARIABLE-NAME = <composed-name 1..20> ,WRITE-MODE = *REPLACE / *EXTEND *LIBRARY-ELEMENT(...) LIBRARY = <filename 1..54 without-vers> ,ELEMENT = <composed-name 1..64_with-underscore>(...) <composed-name 1..64_with-underscore>(...) VERSION = *HIGHEST-EXISTING / *UPPER-LIMIT / <composed-name 1..24_with-underscore> ,TYPE = S / <alphanum-name 1..8> ,WRITE-MODE = *REPLACE / *EXTEND |
Operands
VARIABLE-NAME =
Designates the variables to be output.
VARIABLE-NAME = *ALL
All variables having the scope specified under SCOPE are output in the lexical order of their variable names. Elements in structures are output in the order of their declarations, while array elements are output in the numerical order of their array indices.
VARIABLE-NAME = *LIST(...)
The elements of a list variable are to be output
LIST-NAME = <composed-name 1..255>
Name of the list variable.
FROM-INDEX = *FIRST / *LAST / <integer 1..2147483647>
Index of the element of the list variable with which the output is to begin.
*FIRST: The output will begin with the first element in the list; default.
Specifying *LAST causes the last element in the list to be output. In this case the NUMBER-OF-ELEMENTS operand is ignored.
NUMBER-OF-ELEMENTS = 1 / *REST / <integer 1..2147483647>
Number of list elements which are to be output. Default: one element is output. Specifying *REST causes all elements from the specified start element (FROM-INDEX operand) to the last element in the list to be output.
VARIABLE-NAME = list-poss(2000): <composed-name 1..255>
Names of the variables to be output.
These names are output in the specified order.
VARIABLE-NAME = <structured-name 1..20 with-wild(40)>
The variables whose names match the search pattern are output is alphabetical order by name.
SELECT = *BY-ATTRIBUTES(...)
Designates the variables to be output in greater detail.
SCOPE =
Designates the scope of the variables to be output.
SCOPE = *VISIBLE
Outputs all visible variables.
A variable is visible if it is not overlaid by a declaration in an include procedure.
SCOPE = *PROCEDURE
Outputs all variables, even if they are overlaid by a declaration in an include procedure.
SCOPE = *CURRENT
Outputs the current variables, namely: within a call procedure, the variables of the call procedure; within an include procedure, the variables of the include procedure.
SCOPE = *CURRENT-PARAMETERS
Outputs the current procedure parameters, i.e. the procedure parameters within a call procedure, and the procedure parameters of the include procedure within an include procedure.
SCOPE = *TASK-ALL
Outputs all the task-global variables.
SCOPE = *TASK-VISIBLE
Outputs the imported task-global variables, or the task-global variables which were declared in the procedure.
SCOPE = *CALLING-PROCEDURE
Outputs all the variables of the scope of the calling procedure declared with IMPORT-ALLOWED = *YES. In the case of foreground procedures, this scope consists of all calling procedures starting from the dialog level, and in the case of background procedures, all calling procedures starting from the first procedure.
INITIALIZATION =
Specifies whether or not non-initialized variables are to be output.
INITIALIZATION = *YES
Only initialized variables are output.
INITIALIZATION = *ANY
All variables (whether initialized or non-initialized) are output.
INFORMATION = *PARAMETERS(...)
Specifies the information which is output.
VALUE =
Specifies whether the values of the variables should be output, and in what format.
VALUE = *WITHOUT-QUOTES
Outputs variables with the data type STRING
without apostrophes.
VALUE = *C-LITERAL
Outputs variables with the data type STRING
as C literals. For non-initialized strings, the string ’*NO-INIT’ is output.
VALUE = *X-LITERAL
Outputs variables with the data type STRING
as X literals. For non-initialized strings, the string ’*NO-INIT’ is output.
VALUE = *NONE
The value of the variable is not output, only its name (see the NAME operand).
NAME =
Specifies the format in which the names of the variables are output.
NAME = *FULL-NAME(...)
Outputs full variable names.
LIST-INDEX-NUMBER = *NO / *YES
You can specify if the element number is to be appended to the name instead of (*LIST) for list elements.
LIST-INDEX-NUMBER = *NO
Variablename(*LIST) = <contents> for the first element
Variablename(*LIST) = <contents> for the second element, etc.
LIST-INDEX-NUMBER = *YES
Variablename#1 = <contents>for the first element
Variablename#2 = <contents>for the second element, etc.
Outputs the element names of the variables. This is also the output format in which the data type STRUCTURE
is output.
LIST-INDEX-NUMBER = *NO / *YES
You can specify if the output is to start with (*LIST) or with the element number.
LIST-INDEX-NUMBER = *NO
(*LIST) = <contents> for the first element
(*LIST) = <contents> for the second element, etc.
LIST-INDEX-NUMBER = *YES
#1 = <contents> for the first element
#2 = <contents> for the second element, etc.
The names of variables are not output.
OUTPUT =
Designates the output medium.
OUTPUT = *SYSOUT
Output to SYSOUT.
OUTPUT = *SYSLST
Output to SYSLST. (To ensure correct printed output, each data line starts with “ ”.)
OUTPUT = <filename 1..54 without-gen-vers>(...)
Output to the specified file, which must be a SAM file.
WRITE-MODE = *REPLACE
The current contents of the file are to be overwritten.
WRITE-MODE = *EXTEND
The output is to be appended to the current contents.
OUTPUT = *VARIABLE(...)
Output to a list variable.
VARIABLE-NAME = <structured-name 1..20>
Name of the list variable.
WRITE-MODE = *REPLACE
The current contents of the list variable are to be overwritten.
WRITE-MODE = *EXTEND
The list variable is to be extended, i.e. the output is to be appended to the current contents.
OUTPUT = *LIBRARY-ELEMENT(...)
Output to an element in a PLAM library.
LIBRARY = <filename 1..54 without-vers>
Name of the PLAM library.
ELEMENT = <composed-name 1..64_with-underscore>(...)
Name of the element.
VERSION =
Designates the version number of the element.
VERSION = *HIGHEST-EXISTING
Selects the highest existing version number.
VERSION = *UPPER-LIMIT
Selects the highest possible version number.
VERSION = <composed-name 1..24_with-underscore>
Selects the specified version number.
TYPE = S / <alphanum-name 1..8>
Designates the element type.
WRITE-MODE = *REPLACE
The existing content of the element is to be overwritten.
WRITE-MODE = *EXTEND
The element is to be extended, i.e. the output is to be appended to the existing content.
Command return codes
It is possible that part of the command has been processed and executed when the error occurs. In this case, the result of the command is not guaranteed.
(SC2) | SC1 | Maincode | Meaning/Guaranteed messages |
0 | CMD0001 | No error | |
1 | 0 | CMD0001 | Warning; no variable found |
1 | CMD0202 | Syntax error | |
3 | CMD2203 | Incorrect syntax file | |
32 | CMD0221 | System error (internal error) | |
64 | SDP0091 | Semantic error Guaranteed message: SDP1008 | |
130 | SDP0099 | No further address space available |
Example
The following variable is declared in the procedure “proc1“:
/DECLARE-VARIABLE VARIABLE-NAME=VALUE(TYPE=*INTEGER,*INITIAL-VALUE=122),- /SCOPE=*PROCEDURE(IMPORT-ALLOWED=*YES) /CALL-PROCEDURE Proc2
Procedure ”proc2“ contains the following:
/SHOW-VARIABLE VARIABLE-NAME=*ALL,SELECT=*BY-ATTRIBUTES- /(SCOPE=*CALLING-PROCEDURES) A=122
Description of output formats
Depending on the entries for INFORMATION, a number of different output formats are created. The output is not the same as a sequence of SET-VARIABLE commands.
Example
/DECLARE-VARIABLE NAME(INIT-VALUE = 'MILLER') /DECLARE-VARIABLE AGE(TYPE = *INTEGER, INIT-VALUE = 22) /DECLARE-VARIABLE LANGUAGES,MULTIPLE-ELEMENTS = *LIST /LANGUAGES = 'GERMAN', WRITE-MODE = *EXTEND /LANGUAGES = 'ENGLISH', WRITE-MODE = *EXTEND /DECLARE-VARIABLE GRADES(TYPE = *STRUCTURE(*BY-SYSCMD)) /BEGIN-STRUCTURE /DECLARE-ELEMENT GERMAN(TYPE = *INTEGER, INIT-VALUE = 2) /DECLARE-ELEMENT ENGLISH(TYPE =*INTEGER) /END-STRUCTURE /DECLARE-VARIABLE INTERPRETER(TYPE = *BOOLEAN,INIT-VALUE = TRUE)
1. Output using SELECT = *BY-ATTRIBUTES(INITIALIZATION = *YES)
/SHOW-VARIABLE VARIABLE-NAME=*ALL, SELECT=*BY-ATTRIBUTES - (INITIALIZATION = *YES)
Output
AGE = 22 INTERPRETER= TRUE NAME = MILLER GRADES.GERMAN = 2 LANGUAGES(*LIST)=GERMAN LANGUAGES(*LIST)=ENGLISH *END-OF-CMD
Only initialized variables are output.
2. Output using SELECT = *BY-ATTRIBUTES(INITIALIZATION = *ANY)
/SHOW-VARIABLE VARIABLE-NAME=*ALL, SELECT=*BY-ATTRIBUTES - /(INITIALIZATION = *ANY)
Output
AGE = 22 INTERPRETER= TRUE NAME = MILLER GRADES.GERMAN = 2 GRADES.ENGLISH = *NO-INIT LANGUAGES(*LIST)=GERMAN LANGUAGES(*LIST)=ENGLISH *END-OF-CMD
All variables are output, regardless of whether or not they are initialized.
3. Output using INFORMATION = *PARAMETERS(VALUE = *WITHOUT-QUOTES)
/SHOW-VARIABLE VARIABLE-NAME=*ALL, INFORMATION = *PARAMETERS - /(VALUE = *WITHOUT-QUOTES)
Output
AGE = 22 INTERPRETER= TRUE NAME = MILLER GRADES.GERMAN = 2 LANGUAGES(*LIST)=GERMAN LANGUAGES(*LIST)=ENGLISH *END-OF-CMD
String variables are output without quotes.
4. Output using INFORMATION = *PARAMETERS(VALUE = *C-LITERAL)
/SHOW-VARIABLE VARIABLE-NAME=*ALL, INFORMATION = *PARAMETERS - /(VALUE = *C-LITERAL)
Output
AGE = 22 INTERPRETER = TRUE NAME = 'MILLER' GRADES.GERMAN = 2 LANGUAGES(*LIST) = 'GERMAN' LANGUAGES(*LIST) = 'ENGLISH' *END-OF-CMD
String variables are output as C literals.
5. Output using INFORMATION = *PARAMETERS(VALUE = *X-LITERAL)
/SHOW-VARIABLE VARIABLE-NAME=*ALL, INFORMATION = *PARAMETERS - /(VALUE = *X-LITERAL)
Output
AGE = 22 INTERPRETER = TRUE NAME = X'D4C9D3D3C5D9' GRADES.GERMAN = 2 LANGUAGES(*LIST) = X'C7C5D9D4C1D5' LANGUAGES(*LIST) = X'C5D5C7D3C9E2C8' *END-OF-CMD
String variables are output as X literals.
6. Output using INFORMATION = *PARAMETERS(VALUE = *NONE)
/SHOW-VARIABLE VARIABLE-NAME=*ALL, INFORMATION = *PARAMETERS - /(VALUE = *NONE)
Output
AGE INTERPRETER NAME GRADES.GERMAN LANGUAGES(*LIST) LANGUAGES(*LIST) *END-OF-CMD
Only the variable names are output.
7. Output using INFORMATION = *PARAMETERS(NAME=*FULL-NAME)
/SHOW-VARIABLE VARIABLE-NAME=GRADES, INFORMATION = *PARAMETERS - /(NAME=*FULL-NAME)
Output
GRADES.GERMAN = 2
The full element name is output.
8. Output using INFORMATION = *PARAMETERS(NAME=*ELEMENT-NAME)
/SHOW-VARIABLE VARIABLE-NAME=GRADES, INFORMATION = *PARAMETERS - /(NAME=*ELEMENT-NAME)
Output
GERMAN = 2
Only element names are output.
9. Output using INFORMATION = *PARAMETERS(NAME=*NONE)
/SHOW-VARIABLE VARIABLE-NAME=GRADES, INFORMATION = *PARAMETERS - /(NAME=*NONE)
Output
2
Only variable values are output.
Further examples
Input
/DECLARE-VARIABLE STREET('XYZ WAY', *STRING) /DECLARE-VARIABLE NUMBER(12, *INTEGER) /DECLARE-VARIABLE NAME('HUGO') /DECLARE-VARIABLE MARRIED(TRUE, *BOOLEAN) /SHOW-VARIABLE *ALL
Output
NAME = HUGO NUMBER = 12 STREET = XYZ WAY MARRIED = TRUE *END-OF-CMD
Input
/SHOW-VARIABLE (NAME, STRASSE, NUMMER), - / INFO=*PAR(VALUE=*C-LITERAL,NAME= *FULL-NAME)
Output
NAME = 'HUGO' STREET = 'XYZ WAY' NUMBER = 12
Input
/DECLARE-VARIABLE A(TYPE = *STRUCTURE(*DYNAMIC)) /A.C = 'TWO' /A.D = 'THREE' /A.B = 'ONE' /SHOW-VARIABLE A, INFO=*PAR(VALUE=*C-LITERAL,NAME= *FULL-NAME)
Output
A.C = 'TWO' A.D = 'THREE' A.B = 'ONE'
Input
/SHOW-VARIABLE A, INFO=*PAR(VALUE=*C-LITERAL,NAME= *ELEMENT-NAME)
Output
C = 'TWO' D = 'THREE' B = 'ONE'
Input
/DECLARE-VARIABLE V2(TYPE=*ANY),MULT-ELEM=*LIST /S = '(ANTON,BERTA,CAESAR,HUGO,FRANZ)' /V2 = *STRING-TO-VARIABLE(S)
Output
/SHOW-VARIABLE *LIST(LIST=V2,FROM-INDEX=3,NUM-OF-ELEM=*REST),- / INFO=*PAR(VALUE=*C-LITERAL,LIST-INDEX-NUMBER=*YES) V2#3 = 'CAESAR' V2#4 = 'HUGO' V2#5 = 'FRANZ'