Previous Topic: &00

Next Topic: PSM Interface


&000

&000 returns the value of the NCL global variable prefix.

NCL supports global variables that is set and shared by all NCL procedures throughout the system. Global variables are identified by a unique prefix. This is, by default, set to GLBL.

An installation can alter the default global variable prefix using the SYSPARMS NCLGLBL command. A change to this prefix would then require subsequent changes to all NCL procedures that referenced global variables. To eliminate this problem the &000 system variable is set to the current value of the global variable prefix. This makes it possible for global variables to be referenced using complex variable techniques that cause the name of the variable to be dynamically resolved to include the current global variable prefix.

For example, consider that the current global variable prefix is #$ and that a variable &#$Z1 has been created. This could be referenced in the following way:

&WRITE DATA=THE CURRENT VALUE OF GLOBAL Z1 IS &#$Z1

An alternative method using the &000 system variable would be:

&WRITE DATA=THE CURRENT VALUE OF GLOBAL Z1 IS &&000Z1

&000 takes advantage of the NCL parsing rule that delimits a numeric variable at the first non-numeric character. Thus, when resolving the value of &&000Z1, &000 is delimited at the character Z, and resolved to #$, which is the current value of the global variable prefix. Parsing then continues to resolve the value of &#$Z1.

Example: &000

&&000Z1 = &STR THIS IS DATA IN GLOBAL VARIABLE Z1

Note: Do not use a single character for the global variable prefix in your system-always use a combination of at least two characters, preferably a combination of the national characters, for example @#$. This minimizes the risk of the global variable prefix clashing with any other user variables. You should also set NCL coding standards for your installation which prevent naming conventions that conflict with your choice of global variable prefix.