Hi , here i'm sending sample code by trating all the datafiles in a folder as library in windows envornment. %macro write_to_csv; proc sql; select memname into :dnames separated by ' ' from dictionary.tables where libname='WORK' and memtype='DATA'; select count(*) into :counts from dictionary.tables where libname='WORK' and memtype='DATA'; quit; %do i= 1 %to &counts ; %let dname=%scan(&dnames,&i,' ' ); ods csvall file="c:\test\&dname..csv"; proc print data=&dname noobs; run; ods csvall close; %end; %mend ; %write_to_csv;
... View more