Hi edwolfe,
You can achieve this by the following code:
%macro test(list);
%put LIST=*;
%do i=1 %to %sysfunc(countw(&list));
%put %scan(&list,&i);
%end;
%put *;
%mend test;
%test(1 2 3 4);
This code should produce
LIST=*
1
2
3
4
*
Or, if you need to output it to an external file, you can use the following code modification:
%macro test(list);
data _null_;
file 'c:\temp\test.txt';
put 'LIST=*' /
%do i=1 %to %sysfunc(countw(&list));
"%scan(&list,&i)" /
%end;
'*';
run;
%mend test;
%test(1 2 3 4);
Hope this helps.
... View more