Is there a more streamlined way of accomplishing this? This is a simplified example. In the real case there are > 10 values of var
, each of which need their own dataset.
data
new1
new2
new3;
set old;
if var = 'new1' then output new1;
else if var = 'new2' then output new2;
else if var = 'new3' then output new3;
run;
This should work out. You just need to change the %to 5 to 10 (the max new number). The point made by @Reeza is great. I would also take a look at that post since it's an important suggestion. Usually this is not a good way to handle data, but this should get you around.