@RW9 wrote:
data want (keep=word);
do i=1 to countw(string_from_excel," ");
word=scan(string_from_excel,i," ");
output;
end;
run;
Whilst not knowing how the string is got, i.e. if its an import just read it into a dataste there, its pretty simple to break it out into data, this may however be overkill for 1 or 2 parameters, but in that case just change the source.
I agree of course that sometimes there are restrictions, but how many times are those restrictions self imposed?
Yes you could type this code every time you encounter this situation to get the string values into a data step; or you could simply, one time, create a macro to do get the end result you want (as I have done) and avoid the data step portion, and then use %put_quotes_around(¯ovariablename) ... which is easier to remember, and in my opinion, more readable.
By the way, yes this is data, it is string data, so data steps will do a fine job on it; and macros work well on string data in this case.
... View more