BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi there,
I'm using SAS 8.0.2 ,,I know too old but that is what we have at work. I have a quick question. I need to pull my data into different excel sheets. Can someone tell me what are my options???

I have previously worked with 9.1 and it was easy using tagsets .. but now here it is a different scenario.. Any help is greatly appreciated.

-Matt
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
TAGSETS.EXCELXP, was possible in later versions of SAS because the underlying TAGSET template syntax changed. So, sadly, there is no equivalent to TAGSETS.EXCELXP for your version of SAS.

However, if you cannot use TAGSETS.EXCELXP, there is a way in Excel technology to link multiple HTML files together in a directory structure. For example, the c:\temp\main_report.html file -- would be the main HTML file
and this "main" file would point to a set of files in a sub-directory structure like this:

[pre]
c:\temp\main_report.html
|
+----c:\temp\main_report_files\filelist.xml
|
+----c:\temp\main_report_files\wombat.html
|
+----c:\temp\main_report_files\koala.html
|
+----c:\temp\main_report_files\mystyle.css
[/pre]

You can create the 2 HTML files and the CSS file with ODS. The main_report.html file and the filelist.xml file would have to be built manually or inside a DATA step program...you have to know the names of all the HTML and CSS files (and any image file names) before you can build filelist.xml or the main_report.html file. The Microsoft documentation talks about how to link the HTML files together. Also, this presentation from a previous SAS user group may help get you started:
http://support.sas.com/rnd/base/ods/excel/multisheet_excel_post.ppt

So, then, if you opened main_report.html with Excel, it would, then open a multi-sheet workbook, where each HTML file was displayed on a separate tab or worksheet.

I have only seen the above technique with HTML files being linked together and then the "main" HTML file was opened with Excel. Of course, Excel "knows" that it opened a set of HTML files, so this will not be a true, binary Excel workbook (note that even if you name the file "main_report.xls" -- you will not be fooling Excel -- it still knows that you've only changed the file extension so Excel launches when you double click on the file name), but still, this would achieve something close to what you want in this older version of SAS where only ODS HTML is available to you.

Your other choice might be to generate a bunch of CSV files (using DATA _NULL_) and then to write a VBScript or Excel macro to load each CSV file onto a different sheet in a workbook.

cynthia
Chevell_sas
SAS Employee
If you don't mind a hardcoded style, there might be another option here using the below sample for 8.2.

Chevell

http://support.sas.com/rnd/base/ods/templateFAQ/excelexamples.html#excel82

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
  • 2 replies
  • 820 views
  • 0 likes
  • 3 in conversation