Skip to content

Instantly share code, notes, and snippets.

@statgeek
Created September 25, 2015 17:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save statgeek/4bfb7574713bedf4e011 to your computer and use it in GitHub Desktop.
Save statgeek/4bfb7574713bedf4e011 to your computer and use it in GitHub Desktop.
SAS - split file into subsets using call execute
proc sort data=sashelp.class out=class;
by age;
run;
data _null_;
set class;
by age;
retain count;
if first.age then do;
count+1;
*create string;
str1='data sub'||put(count,z3.)||"; set sashelp.class; where age="||put(age, 2.)||";run;";
call execute(str1);
end;
run;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment