Referencing Variables Through RAID
Enter variable names as they appear in the BASIC source program. They are case-sensitive, so "A" is not the same variable as "a".
In addition to regular variable names, you can reference some special "register" variables with RAID. InfoSphere® DataStage® BASIC object code is executed by the run machine. When you assign a new variable, the run machine allocates memory for that variable and creates a pointer to that memory location. There are special variables that the run machine uses to hold temporary information. These are the "registers" that can be referenced by $R0 through $Rn, and a matrix address variable referenced by $MATRIX. An arbitrary number of these registers is available, depending on the needs of your program. The appropriate amount is always made available. You never have more than you need.
Registers hold intermediate values in a program. For example, for the following statement the sum of 3 and 4 is evaluated and placed in $R0:
A=B:3+4
The object code evaluates the statement as:
A=B:$R0
The $MATRIX variable is sometimes used as a pointer to a specific element of an array. It avoids the need to locate the element more than once in the same statement. For example, in the REMOVE statement, the following statement allows for successive system-delimited substrings in the third element of array B to be put in variable A and a delimiter code setting put in variable C:
REMOVE A FROM B(3) SETTING C
The reference to the third element of array B is put in the $MATRIX pointer. The object code evaluates the statement as follows:
REMOVE A FROM $MATRIX SETTING C