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
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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