Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

SHOW-VARIABLE-ATTRIBUTES Output variable attributes

&pagelevel(4)&pagelevel

Domain: PROCEDURE

Command description

The SHOW-VARIABLE-ATTRIBUTES command supplies information about the attributes of the specified variables. The information is output to SYSOUT (or an S variable /
S variable stream) or to SYSLST.
The attributes include the name of the variable, its initial value, data type, whether it is a simple or a complex variable, etc. Variable attributes are declared using the /DECLARE-VARIABLE command or preset at the time the variable is generated.

Format

SHOW-VARIABLE-ATTRIBUTES

VARIABLE-NAME = *ALL / <structured-name 1...20 with-wild(40)> / <composed-name 1...255> / *LIST(...)

*LIST(...)

LIST-NAME = <composed-name 1..255>

,FROM-INDEX = *FIRST / *LAST / <integer 1..2147483647>

,NUMBER-OF-ELEMENTS = 1 / *REST / <integer 1..2147483647>

,INFORMATION = *NAME / *VARIABLE-ATTRIBUTES-ONLY / *ALL-ATTRIBUTES

,ATTACHED-INFORMATION = *NO / *YES

,OUTPUT = *SYSOUT / *SYSLST

Operands

VARIABLE-NAME =
Specifies the variable whose attributes are to be output.

VARIABLE-NAME = *ALL
All procedure-local, visible variables are to be output.

VARIABLE-NAME = <composed-name 1...255>
Name of the variable whose attributes are to be output.

VARIABLE-NAME = <structured-name 1...20 with-wild(40)>
Specification of one or more variables via a name including wildcards.

VARIABLE-NAME = *LIST(...)
The attributes of 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 attributes of 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 whose attributes are to be output. Default: the attributes of one element are output.
Specifying *REST causes the attributes of all elements from the specified start element (FROM-INDEX operand) to the last element in the list to be output.

INFORMATION =
Defines the extent of the information to be output.

INFORMATION = *NAME
Only the name of the variable is to be output.

INFORMATION = *VARIABLE-ATTRIBUTES-ONLY
All attributes specified with the DECLARE-VARIABLE command are to be output.

INFORMATION = *ALL-ATTRIBUTES
All attributes specified with the /DECLARE-VARIABLE command are to be output. A list of the names of variable elements is additionally output.

ATTACHED-INFORMATION =
Determines whether the attributes of variable elements are to be output.

ATTACHED-INFORMATION = *NO
Only the attributes of the variable are to be output.

ATTACHED-INFORMATION = *YES
The attributes of the variable as well as its elements are to be output.

OUTPUT =
Determines whether the information is to be output to SYSOUT or to SYSLST.

OUTPUT = *SYSOUT
The information is output to SYSOUT. The ASSIGN-SYSOUT or ASSIGN-STREAM command can be used to stipulate output to an S variable or an S variable stream.

OUTPUT = *SYSLST
The information is output to SYSLST only.

Command return codes

(SC2)

SC1

Maincode

Meaning


0CMD0001No error

1CMD0202Syntax error

3CMD2203Incorrect syntax file

32CMD0221System error (internal error)

64SDP0091Semantic error (variable does not exist)

Guaranteed message: SDP1008


130SDP0099No further address space available

Example

/declare-variable S(type = *structure),multiple-elements=*array
/S#81.A = 'First Value'
/S#81.B#5 = 'Second Value'
/S#81.B#27 = 'Third Value'
/S#97.A = 'First Value'
/S#97.B#8 = 'Second Value'
/S#97.B#13 = 'Third Value' 
/show-variable-attributes s,info=*all-attributes, attached-information=*yes
VARIABLE-NAME = S
 TYPE = *STRUCTURE(DEFINITION = *DYNAMIC)
 MULTIPLE-ELEMENTS = *ARRAY(LOWER-BOUND = 0, UPPER-BOUND = 2147483647)
 SCOPE = *PROCEDURE(IMPORT-ALLOWED = *NO)
 CONTAINER = *STD
 CONSTANT = *NO
 VALUE-TYPE = *NONE
 VALUE = 
 NUMBER-OF-ELEMENTS = 2
 ELEM#1 = S#81
 ELEM#2 = S#97
VARIABLE-NAME = S#81
 TYPE = *STRUCTURE(DEFINITION = *DYNAMIC)
 MULTIPLE-ELEMENTS = *NO
 SCOPE = *PROCEDURE(IMPORT-ALLOWED = *NO)
 CONTAINER = *STD
 CONSTANT = *NO
 VALUE-TYPE = *NONE
 VALUE = 
 NUMBER-OF-ELEMENTS = 2
 ELEM#1 = S#81.A
 ELEM#2 = S#81.B
 VARIABLE-NAME = S#81.A
 TYPE = *ANY
 MULTIPLE-ELEMENTS = *NO
 SCOPE = *PROCEDURE(IMPORT-ALLOWED = *NO)
 CONTAINER = *STD
 CONSTANT = *NO
 VALUE-TYPE = *STRING
 VALUE = First Value
 NUMBER-OF-ELEMENTS = 0
VARIABLE-NAME = S#81.B
 TYPE = *ANY
 MULTIPLE-ELEMENTS = *ARRAY(LOWER-BOUND = -2147483648, UPPER-BOUND = 
                     2147483647)
 SCOPE = *PROCEDURE(IMPORT-ALLOWED = *NO)
 CONTAINER = *STD
 CONSTANT = *NO
 VALUE-TYPE = *NONE
 VALUE = 
 NUMBER-OF-ELEMENTS = 2
 ELEM#1 = S#81.B#5
 ELEM#2 = S#81.B#27
VARIABLE-NAME = S#81.B#5
 TYPE = *ANY
 MULTIPLE-ELEMENTS = *NO
 SCOPE = *PROCEDURE(IMPORT-ALLOWED = *NO)
 CONTAINER = *STD
 CONSTANT = *NO
 VALUE-TYPE = *STRING
 VALUE = Second Value
 NUMBER-OF-ELEMENTS = 0
VARIABLE-NAME = S#81.B#27
 TYPE = *ANY
 MULTIPLE-ELEMENTS = *NO
 SCOPE = *PROCEDURE(IMPORT-ALLOWED = *NO)
 CONTAINER = *STD
 CONSTANT = *NO
 VALUE-TYPE = *STRING
 VALUE = Third Value
 NUMBER-OF-ELEMENTS = 0
VARIABLE-NAME = S#97
 TYPE = *STRUCTURE(DEFINITION = *DYNAMIC)
 MULTIPLE-ELEMENTS = *NO
 SCOPE = *PROCEDURE(IMPORT-ALLOWED = *NO)
 CONTAINER = *STD
 CONSTANT = *NO
 VALUE-TYPE = *NONE
 VALUE = 
 NUMBER-OF-ELEMENTS = 3
 ELEM#1 = S#97.A
 ELEM#2 = S#97.B
 ELEM#3 = S#97.B13
VARIABLE-NAME = S#97.A
 TYPE = *ANY
 MULTIPLE-ELEMENTS = *NO
 SCOPE = *PROCEDURE(IMPORT-ALLOWED = *NO)
 CONTAINER = *STD
 CONSTANT = *NO
 VALUE-TYPE = *STRING
 VALUE = First Value
 NUMBER-OF-ELEMENTS = 0
VARIABLE-NAME = S#97.B
 TYPE = *ANY
 MULTIPLE-ELEMENTS = *ARRAY(LOWER-BOUND = -2147483648, UPPER-BOUND = 
                     2147483647)
 SCOPE = *PROCEDURE(IMPORT-ALLOWED = *NO)
 CONTAINER = *STD
 CONSTANT = *NO
 VALUE-TYPE = *NONE
 VALUE = 
 NUMBER-OF-ELEMENTS = 1
 ELEM#1 = S#97.B#8
VARIABLE-NAME = S#97.B#8
 TYPE = *ANY
 MULTIPLE-ELEMENTS = *NO
 SCOPE = *PROCEDURE(IMPORT-ALLOWED = *NO)
 CONTAINER = *STD
 CONSTANT = *NO
 VALUE-TYPE = *STRING
 VALUE = Second Value
 NUMBER-OF-ELEMENTS = 0
VARIABLE-NAME = S#97.B13
 TYPE = *ANY
 MULTIPLE-ELEMENTS = *NO
 SCOPE = *PROCEDURE(IMPORT-ALLOWED = *NO)
 CONTAINER = *STD
 CONSTANT = *NO
 VALUE-TYPE = *STRING
 VALUE = Third Value
 NUMBER-OF-ELEMENTS = 0

Note

If the variable is a list variable, the names of its elements are not listed. Variable elements are identified by the variable name followed by the “#” character and the (sequential) element number instead.Note

Formatted output

The following operands are supported for formatted output in variables for the SHOW-VARIABLE-ATTRIBUTES command:

  • VARIABLE-NAME (all values)

  • INFORMATION (all values)

  • ATTACHED-INFORMATION (all values)

Additional information such as the conditions for assigning values to individual variables can be found in the following table.

Output structure

Output information

Name of the S variable1

T2

Contents

Does the variable have a constant
value (/DECLARE-CONSTANT)?

var#.CONSTANT

S

*YES
*NO

Type of the variable container

var#.CONTAIN

S

<composed-name 1..64>
*STD
*VAR
*JV

Name of the variable container

var#.CONTAIN-NAME

S

<structured-name 1..20>
<filename 1..54>
<string 0..0>

Element name

var#.ELEM(*LIST)

S

<composed-name 1..255>

Import of the variable permitted

var#.IMP-ALLOW

S

*YES
*NO

Maximum number (limit) of list
elements

var#.LIM

I

<integer 0..2147483647>

Lower limit of the array index

var#.LOWER-BOUND

I

<integer -2147483648..2147483647>

The variable is a list variable, an
array variable or a simple variable
(*NO)

var#.MULT-ELEM

S

*LIST
*ARRAY
*NO

Number of variable elements

var#.NUM-OF-ELEM

I

<integer 0..2147483647>

Scope of the variable

var#.SCOPE

S

*INC
*PROC
*TASK

Name of the structure layout

var#.STRUCT-DEFI

S

<structured-name 1..20>
*BY-SYSCMD
*DYNAMIC

Type of the variable

var#.TYPE

S

*ANY
*BOOLEAN
*STRING
*INTEGER
*STRUCT

Upper limit of the array index

var#.UPPER-BOUND

I

<integer -2147483648..2147483647>

Value of the variable

var#.VALUE

S
I
B

<string 0..4096>
<integer -2147483648..2147483647>
FALSE
TRUE

Type of the variable value

var#.VALUE-TYPE

S

*NONE
*BOOLEAN
*STRING
*INTEGER

Name of the variable

var#.VAR-NAME

S

<composed-name 1..255>


1Variable names are sorted alphabetically
2The T column identifies the data types: B = Boolean, I = INTEGER, S = string