As the first step in the decommissioning of sasCommunity.org the site has been converted to read-only mode.
Here are some tips for How to share your SAS knowledge with your professional network.
Looping through tokens in a macro variable with Scan
%macro scanloop(elements); %let j=1; %let key=%scan(&elements.,&j.); %do %until(&key eq %nrstr( )); ... do something with &key ... %let j=%eval(&j+1); %let key=%scan(&elements.,&j.); %end; %mend;
Example usage, where the "do something" part just puts the key to the log:
%scanloop(AAAA BBBB CCCC);
AAAA BBBB CCCC