- data _null_;
- set input nobs=nobs;
- call symputx("nobs", nobs);
- stop;
- run;
- %put nobs=&nobs.;
- %let count=%sysevalf(%sysfunc(ceil(&nobs./100000)));
- %put &count;
- %macro extract;
- %do i=1 %to &count.;
- %if &i.=&count. %then %do;
- data _null_;
- set input (firstobs=%eval((&i-1)*100000+1) obs=max);
- file "D:\TEST\test2\file_&i..txt";
- put text;
- run;
- %end;
- %else %do;
- data _null_;
- set input (firstobs=%eval((&i-1)*100000+1) obs=%eval(&i.*100000));
- file "D:\TEST\test2\file_&i..txt";
- put text;
- run;
- %end;
- %end;
- %mend;
- %extract;