Thanks @ChrisHemedinger
I now understand a bit better how this works.
Just to clarify, here is what I do to build this Excel pack:
- I use the Report Builder Interface to build a number of SAS reports;
- I then export them as .srx format and import in Excel using the SAS Add-In for MS Office. The reports are spread across a number of tabs (and work very well apart from this formatting issue).
I do so in order to have an automated process, and to have everything in one place (Excel).
I see exporting in Html keeps the formatting, but if I had all the outputs in html I'd need to combine all of those in one central place (like I do in Excel).
Using tagsets.MSOffice2k I can only see the html output - I don't see where the excel output is created? here is what I'm using
options sastrace=',,,d' sastraceloc=saslog NOSTSUFFIX; OPTIONS FULLSTIMER; ods tagsets.msoffice2k_x file="%sysfunc(getoption(work))/output.xls" options(panelcols="2") style=normal; Title "Tables"; PROC SQL; Title "Table 1"; SELECT t1.Make, t1.Model, t1.Type, t1.EngineSize FROM SASHELP.CARS t1 WHERE MAKE IN ("Saab", "Volvo") ; QUIT; PROC SQL; Title "Table 2"; SELECT t1.Make, t1.Model, t1.Type, t1.EngineSize FROM SASHELP.CARS t1 WHERE MAKE IN ("BMW", "Infiniti") ; QUIT; ods tagsets.msoffice2k_x close;
again, many thanks
The file is in the WORK folder for your SAS session. EG should detect it and offer to download/open it for you in an external application:
You can also use the Copy Files task in EG to add a download step to your process flow to copy this file from the server to a local folder on your PC.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.