01-14-2016 05:27 PM
I am creating multiple datasets from one dataset using the following code. Do I have list all the 23 dataset names. Is ther way like a1-a23 (this didnot work) i can use to simplify. Thanks.
data a1 a2 a3 a4 a5 a6 a7 to a23;
if then do;
01-14-2016 05:32 PM
If you want to do it that way, then yes you do have to list it out. There are other ways, but the general advice is don't do this.
Your posted code isn't correct, but I'm assuming you have more data somewhere.
01-14-2016 05:34 PM
Unfortunately what you are doing pretty much requires an exact list.
There are some methods to generate lists. One might ask the need for splitting one data set that many ways. Since you are going to have 23 conditions to output the data I wouldn't worry so much about this list of sets.
It may be that your later data processing could use the concept of BY where it will do the same thing for each value of a variable in your data.
01-15-2016 01:25 PM
This example may help:
if first.team then do;
call execute("data "||team||";");
call execute ("set teams (where=(team ='"||strip(team)||"')); run;");
01-16-2016 04:42 PM