09-18-2012 01:48 PM
I have three datasets, and I am exporting the data to excel using libname AS FOLLOWS:
libname excl "..\export\&infl.";
Now the problem is I have three datasets final1, final2, final3.While exporting to excel I have to create thrree tabs with these three datasets and rename the exc el tab as :
Base-line(Geno), Post-Bl(Geno) etc etc.. ie with Hyp[hen and brackets. How can I do that?
I can use libname statement only to export data as My data has very long character fields.
09-18-2012 07:49 PM
ODS does offer you an alternative. Look at the sheet names in the attached screenshot. They were produced with the code shown below.
Instead of your DATA step program, you would replace my PROC PRINT with a PROC PRINT for each dataset that you wanted to create as a sheet in the workbook.
ods listing close;
ods tagsets.excelxp file='c:\temp\testname.xml'
ods tagsets.excelxp options(sheet_name='Base-line(Geno)');
proc print data=sashelp.shoes(obs=3);
ods tagsets.excelxp options(sheet_name='Post-Bl(Geno)');
proc print data=sashelp.cars(obs=3);
ods tagsets.excelxp close;