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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.