BookmarkSubscribeRSS Feed
vimal
SAS Employee
Dear,
Can any one help me out in this aspect. I am using SAS EG4 and working on a proc report.
I want to export 2 proc reports on 2 different sheets of a excel file.
Currently I am using the following command to export excel file to server.
ODS HTML BODY="/sas/<>/<>/BLAV_LIB.xls"

how can i modify this command or use some other, please suggest me.
3 REPLIES 3
andreas_lds
Jade | Level 19
Have you tried using excelxp-tagset instead of html?

[pre]ods tagstes.excelxp file="...";
proc report ...
run;

proc report ...
run;

ods tagsets.excelxp close;[/pre]
Some examples are explained on http://support.sas.com/rnd/base/ods/odsmarkup/excelxp_demo.html#manual
vimal
SAS Employee
Yes I tried, but I want the output in excel format only ,not in xlm format
Can you suggest me how I can get it.
Cynthia_sas
Diamond | Level 26
Hi:
If you look at your file:
ODS HTML BODY="/sas///BLAV_LIB.xls"

with Notepad or any TEXT editor you will see the ODS HTML is NOT making you a true, binary .XLS file. When you use ODS HTML, you are creating an HTML 4.01 ASCII text file. The .XLS extension in the above code is ONLY acting to fool the Windows registry into launching Excel when you double-click on the file created by ODS HTML.

In some ways, TAGSETS.EXCELXP is creating -more- of an Excel file, because the XML created by ODS conforms or follows the Microsoft Spreadsheet Markup Language XML specification, as laid out -- by Microsoft -- for Office 2002/2003.

So, your statement that you want the output in "excel format" would only, truly be satisfied by using PROC EXPORT or the Excel LIBNAME engine. However, if you use either of those methods, the trade-off is that you will have a true, binary, .xls file, but you will not be able to set any fonts or formatting or colors inside the Excel file with SAS.

On the other hand, if you use ODS HTML or ODS TAGSETS.EXCELXP, you have the ability to affect fonts and colors. The difference between ODS HTML and ODS TAGSETS.EXCELXP -- besides the general difference between the more general HTML markup and the more specific Spreadsheet markup is that TAGSETS.EXCELXP automatically gives you the ability to create multiple sheets in one workbook. You do not have this capability, automatically, with ODS HTML methods.

cynthia

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1192 views
  • 0 likes
  • 3 in conversation