- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Dear All
I have multiple(More than 10)date sets in Work Library and i want them into Single .CSV file With Multiple Sheets(each data set in different sheets on a Single .Csv File).
Can Anyone Help Me with Proper Code For above problem.
Thank you in Advance
Regards
Nehemiah
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
CSV files are plain text files. Not spreadsheet files. Therefore, you can not have multiple sheets in a single CSV file. It does not make sense.
I assume that what you actually want is to export data into multiple sheets in an .XLSX file?
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
sir thanks for your solution.
sir l will explain in a clear manner.i have an excel file with some data..and my SAS Environment have permissions only for CSV files to import and export.so when i want to get the from excel to sas data set firstly i convert that excel into .csv and that file looked as excel..
so that's why i am asking multiple data sets into csv.
thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
This could be done with multiple data-null-steps using file-statement and the mod option. But i would not export datasets with different variables into one file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I Don't follow this exactly. Do you want to export all the data sets into a single .CSV file? I would not recommend that.
I think what you want to do is to export the data sets into multiple .CSV files and then import those into a single Excel Workbook with multiple sheets (1 for each .CSV File)).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
If my assumption is correct, you can do something like this and insert the relevant path. Then import the CSV Files to Excel
data a;set sashelp.class;run;
data b;set sashelp.class;run;
data c;set sashelp.class;run;
data _null_;
set sashelp.vtable(where=(libname='WORK') keep=libname memname);
call execute(compbl(cat(
"Proc export data=",memname, "
outfile='INSERT_PATH_HERE\", memname, ".csv'
dbms=csv
replace;
run;"
)));
run;