CA-GSS Statements and Commands › GSS Extended Functions › IO Functions › Number, String, and Variable Functions › System Information Functions › $GLOBAL()
$GLOBAL()
This function allocates global variables that contain strings longer than 80 characters.
Syntax
result = $GLOBAL(ALLOC,&name,length)
Parameters
- result
-
Null string if the operation was successful. Otherwise, error text is returned.
- &name
-
Name of a global variable to be allocated. This variable must not have been previously used in any manner. If the name is coded directly in the function, it must be enclosed in single or double quotes. The name can also be placed in another variable and that variable name is specified as the argument.
- length
-
Number of bytes to be reserved for data. The future assignments of data strings can take any length up to this value.
Usage Notes
- The stored strings in global (&) variables are typically limited to 80 characters.
- Due to the compiled nature of the implementation of REXX by CA, variables are allocated storage before IMOD execution begins. When an IMOD that contains any reference to a global variable starts to execute, the variable is pre-allocated before the first REXX instruction is executed. This is true even if the reference is not executed. Therefore, you cannot code an IMOD that calls $GLOBAL() to allocate a global variable and then attempts to use the variable. Instead, execute the $GLOBAL() function and then call another IMOD to use the variable.
Return Codes
- 101 - 103
-
ARG n MISSING OR INVALID
Example
result = $global('alloc','&bigvar',1000)
vname = '&bigvar'
result = &global('alloc',vname,500)
Copyright © 2014 CA Technologies.
All rights reserved.
|
|