04-16-2015 10:03 AM
I would like to create a permanent datasets that contains the first 1000 records of all the datasets in the work directory. I came up with this code:
%let workdsets =
set work.&workdsets. (obs=1000);
proc export data = datas.&workdsets._1000
outfile = "/xxx/xxxx/xxx/&workdsets._1000.csv"
dbms = csv replace;
it didnt work. what can I do to efficiently create those data sets.
04-16-2015 10:19 AM
set sashelp.vtable (where=(libname="WORK"));
call execute('proc export data=work.'||strip(memname)||' (obs=1000) outfile="...\'||strip(memname)||'.csv" dbms=csv replace; run;');
The ... indicates path to location.