BookmarkSubscribeRSS Feed
podarum
Quartz | Level 8

Hi, I'm trying to send over the output form 4 proc tabulates into the same Excel file, but into 4 separate worksheets. Using ODS html body.  Any way on how to do this?

Options Missing = '0';

ods html body = C:\Excel file.xls' style=minimal;

options nodate nocenter pageno=1;

Thanks

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:

  When you use ODS HTML (or any of the HTML-based destinations) it is the default for Excel to render your single HTML file as a single worksheet. This is the Microsoft rule for rendering HTML. If you use ODS MSOFFICE2K_X destination, you would need to create 4 separate HTML files, one for each TABULATE and then pass the names of those 4 files into your ODS MSOFFICE2K_X invocation in order to create a multi-sheet workbook using HTML-based methods.

  On the other hand, if you used TAGSETS.EXCELXP as your destination you would automatically get a separate worksheet for each TABULATE.

  The instructions for using ODS MSOFFICE2K_X destination can be found here:

http://support.sas.com/rnd/base/ods/odsmarkup/msoffice2k/index.html#multiple;

  When you use ODS MSOFFICE2K, ODS MSOFFICE2K_X or ODS HTML, you are not creating "true, binary" Excel (xls) files. You are merely creating HTML files that Excel knows how to open and render. Naming the file with a .xls extension merely "fools" the Windows registry into launching Excel when you click on the file icon. You can prove this to yourself by looking inside your file from ODS using NOTEPAD or a text editor. Then you will see the HTML tags inside the file. Excel is not very happy to render HTML4 tags, (which is the "flavor" of HTML created by ODS HTML)...it is better to use ODS MSOFFICE2K, ODS MSOFFICE2K_X or ODS TAGSETS.EXCELXP -- all of these destinations either create HTML files or XML files that conform to the Excel specification.

cynthia

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 5878 views
  • 0 likes
  • 2 in conversation