An alternative to Reeza's solution is to use a for-loop rather than a while (for people that don't trust while loops): data want;
set have;
array parsed_vars(*) new_var1-new_var6;
do i = 1 to 6;
parsed_vars(i) =scan(str, i, ".");
end;
run; The 6 can be redefined as a macro variable. In my code I have a length statement before the array statement, I do not know whether it works for al data without the length statement.
... View more