Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

VARIABLE-ATTRIBUTE( ) Request variable attributes

&pagelevel(3)&pagelevel

Domain: Variable access (variable attributes)

The VARIABLE-ATTRIBUTE( ) function supplies the value of the specified attribute for the specified variable. Attributes are the variable attributes defined with SDF-P command DECLARE-VARIABLE. Keywords for the request are normally the operand names of the command.

Detailed information on structures must be requested with ATTRIBUTE = *STRUCTURE-INFO (not ATTRIBUTE = *TYPE).

Format

VARIABLE-ATTRIBUTE( )

VAR-ATTR( )

VARIABLE-NAME = string_expression

,ATTRIBUTE = *TYPE / *CONTAINER / *CONTAINER-NAME / *CONTAINER-SCOPE /

*MULTIPLE-ELEMENTS / *SCOPE / *STRUCTURE-INFO

Result type

STRING

Input parameters

VARIABLE-NAME = string_expression
Designates a variable. The variable name must be enclosed in apostrophes if it is specified directly, i.e as a literal (see the following example and the last example in the description of IS-DECLARED( ) ).

ATTRIBUTE =
Designates a variable attribute.

ATTRIBUTE = *TYPE
Supplies the variable type.
If the variable designated by “string_expression” is a structure, only the value *STRUCTURE is supplied.

ATTRIBUTE = *CONTAINER
Supplies the type of the variable container.

ATTRIBUTE = *CONTAINER-NAME
Supplies the name of the variable container.

ATTRIBUTE = *CONTAINER-SCOPE

Supplies the scope of the variable container.

ATTRIBUTE = *MULTIPLE-ELEMENTS
Supplies the type of the complex variable.

ATTRIBUTE = *SCOPE
Supplies the scope of the variable.

ATTRIBUTE = *STRUCTURE-INFO
Supplies the attributes of the complex variable designated by “string_expression” and having the type “structure”. These attributes are defined with the operand TYPE = *STRUCTURE(DEFINITION = ...) in the DECLARE-VARIABLE command.

Result

Value of the attribute in the form of a string.

Input parameter
ATTRIBUTE =

Result

*TYPE

'*ANY' / '*BOOLEAN' / '*INTEGER' / '*STRING'
Variable type

'*STRUCTURE'
“string_expression” designates a structure.

*CONTAINER

'*STD' / '*VARIABLE' / '*JV' / 'composed-name'
Type of variable container

*CONTAINER-NAME

'name' / “
Name of the variable container or job variable

If the variable does not have a container:
error message.

*CONTAINER-SCOPE

'*INCLUDE' / '*PROCEDURE' / '*TASK'
Scope of the variable container

If the variable does not have a container:
error message.

'*ARRAY' / '*LIST'
Type of the complex variable

'*NO'
“string_expression” is neither an array nor a list.

*MULTIPLE-ELEMENTS

*SCOPE

'*INCLUDE' / '*PROCEDURE' / '*TASK'

Scope of the variable designated with
“string_expression”.

*STRUCTURE-INFO

'*BY-SYSCMD'
“string_expression” designates a static structure.

'*DYNAMIC'
“string_expression” designates a dynamic structure.

'name'
Name of the structure layout.

Error messages

SDP0424    NO CONTAINER ASSIGNED TO VARIABLE '(&00)'
SDP0425    BUILTIN FUNCTION VAR-ATTRIBUTES: VARIABLE NOT A STRUCTURE 
SDP1007    NO VARIABLE DECLARED 
SDP1101    SYNTAX ERROR IN VARIABLE NAME 

Example 1

/BEGIN-STRUCTURE PERSON
...
/END-STRUCTURE
/DECLARE-VARIABLE A (TYPE = *STRUCTURE(PERSON))
...
/B = VARIABLE-ATTRIBUTE(VARIABLE-NAME = 'A', ATTRIBUTE = *TYPE)
/SHOW-VARIABLE B
B = *STRUCTURE
/B = VARIABLE-ATTRIBUTE(VARIABLE-NAME = 'A', ATTRIBUTE = *STRUCTURE-INFO)
/SHOW-VARIABLE B
B = PERSON

Example 2

/OPEN-VARIABLE-CONTAINER mycontainer,*LIB(mylibrary)
/DECLARE-VARIABLE myvar, CONTAINER= mycontainer
/A = VARIABLE-ATTRIBUTE('myvar',*CONTAINER)
/SHOW-VARIABLE A
A = MYCONTAINER
/A = VARIABLE-ATTRIBUTE('myvar',*CONTAINER-NAME)
/SHOW-VARIABLE A
A = “null string”