Hello,
I would like to know if there is a sample way to preserve the dataset format while exporting the output results from SAS to an xlsx file.
Please note that I am using proc export.
%macro Export2;
proc export
data=Final
dbms=xlsx
outfile="\\iagsrvfic01\report.xlsx"
replace;
sheet=Rate;
run;
%mend Export2;
%Export2;
I have tried ODS Tagset.ExcelXP but I received an error message due to the Excel format file (xlsx instead of xls)
ODS Tagset.ExcelXP file="\\iagsrvfic01\report.xlsx" ;
PROC PRINT DATA=Final;
VAR var1 var2 var3;
VAR var4 var5 / style={TAGATTR='format:0.00'};
RUN;
ODS tagsets.ExcelXP CLOSE;
Regards,
No, proc export is a basic dump of the data.
Use ods tagsets.excelxp, which can create nice outputs. The thing you get is not an error, it is a warning from Excel. It is telling you that the file you have - the output from the tagsets - is XML, yet you have given it the file extension XLSX. So Excel is telling you that this does not match. It is again, not an error, its it perfectly understandable. Call the output file xml, and then open it with Excel (not double click on it which will defaut to opening with browser). The file extension is important, and this tells programs what the file is.
Or use the newer one ods excel:
Which creates actual xlsx files, but you have to have a recent SAS version.
No, proc export is a basic dump of the data.
Use ods tagsets.excelxp, which can create nice outputs. The thing you get is not an error, it is a warning from Excel. It is telling you that the file you have - the output from the tagsets - is XML, yet you have given it the file extension XLSX. So Excel is telling you that this does not match. It is again, not an error, its it perfectly understandable. Call the output file xml, and then open it with Excel (not double click on it which will defaut to opening with browser). The file extension is important, and this tells programs what the file is.
Or use the newer one ods excel:
Which creates actual xlsx files, but you have to have a recent SAS version.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.