/ Published in: SAS
Use the colon : modifier to build an array.
The colon is like a wildcard. In this case, anything that starts with ash.
SAS Arrays hold variable names which can be used during tedious procedures such as conditional loops.
The colon is like a wildcard. In this case, anything that starts with ash.
SAS Arrays hold variable names which can be used during tedious procedures such as conditional loops.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
data test1; input ash1 ash4 ashley; datalines; 1 2 3 4 5 6 7 8 9 ; run; data test2; set test1; array ashes ash:; c = ashes{1} + ashes{2}; run; /*the result should be as follows:*/ data result; input ash1 ash4 ashley c; datalines; 1 2 3 3 4 5 6 9 7 8 9 15 ; run;