The following statement will create an array of numeric variables. Key points with temporary arrays:
- You must specify the size with a numeric constant (or, as I did here, with a macro variable which evaluates to a numeric constant.)
- Temporary arrays are automatically retained.
- Temporary arrays are not written to the output data set.
Note how I was able to initialize all entries to zero.
array used [&_NVARS] _temporary_ (&_NVARS * 0);
Here I check the value of an element in the array:
if (used[&i] = 0) then do;
Here I set the value of an element in the array:
used[save_i] = 1;
No comments:
Post a Comment