The GETVAR macro reads the contents of a variable. GETVAR can be used with simple variables and elements of complex variables.
Operation | Operands |
GETVAR | MF = E |
MF = D ,PREFIX = G / prefix | |
MF = C ,PREFIX = G / prefix ,MACID = ETV / macid | |
MF = L ,NAMLEN = <integer 1..255> ,NAMADR = <name 1..8> ,SCOPE = *VISIBLE / *TASKONLY ,MAXLEN = <integer 1..4096> ,VALADR = <name 1..8> |
Operands
MF = E
Execute format of the macro call; generates an SVC.
PARAM
Designates the address of the operand list that is evaluated for the macro call (address of macro call with MF = L).
= <name 1..8>
Designates the symbolic address of the operand list.
= (<integer 1..15>)
Designates the register that contains the address of the operand list.
MF = D
DSECT format of the macro call; generates a DSECT for the operand list. The names generated begin with the letter G; they can be modified with PREFIX.
PREFIX = G /prefix
Defines the first character of the generated names.
Default: the generated names begin with the letter G.
MF = C
C format of the macro call; generates an operand list whose symbolic names begin with the string GETV. They can be changed with PREFIX and MACID.
PREFIX = G /prefix
Defines the first character of the generated names.
Default: the generated names begin with the letter G.
MACID = ETV / macid
A string of up to three characters that replaces characters 2 to 4 of the generated names. Default: ETV
MF = L
LIST format of the macro call; generates the operand list for the macro call with MF = E (Execute format); the macro call must be addressable by means of a symbolic address.
NAMLEN = <integer 1..255>
Designates the length of the variable name.
NAMADR = <name 1..8>
Symbolic address of a field containing the variable name.
SCOPE
Designates the scope of the variable.
= *VISIBLE
The variable is a procedure-local variable
= *TASKONLY
The variable is a task-global variable.
MAXLEN = <integer 1..4096>
Designates the length of the field specified as VALADR and thus the maximum length of the variable value.
VALADR = <string 1..8>
Symbolic address of the field to which the variable value to be read is transferred.
Return codes
The table below lists the return codes in hexadecimal notation.
Subcode2 | Subcode1 | Maincode | Meaning |
00 | 00 | 0000 | Macro call was successful; no errors |
00 | 01 | 0001 | Parameter error |
00 | 01 | 0002 | Syntax error in variable name |
00 | 40 | 0003 | Area too small |
00 | 40 | 0004 | Variable not declared |
00 | 40 | 0005 | Variable container not available |
00 | 40 | 0006 | Data type and variable value do not match |
00 | 40 | 0008 | Variable has no value |
00 | 01 | FFFF | Unknown unit or function number |
00 | 02 | FFFF | Function not available |
00 | 03 | FFFF | Wrong version of operand list |