LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (March 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 1 Mar 2004 21:38:41 -0500
Reply-To:   "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Chang Y. Chung" <chang_y_chung@HOTMAIL.COM>
Subject:   Re: using ODS to export to XLS problem......
Comments:   To: mscgloss@YAHOO.COM

On Mon, 1 Mar 2004 16:24:27 -0800, Ixnay <mscgloss@YAHOO.COM> wrote:

>Hello All, > >I know that this issue has been covered ad nauseum, but I'm having a >problem I can't seem to find an answer for. > >I need to export a SAS generated dataset to excel. I used to use PROC >EXPORT, but need to use ODS at my new job. The code I've written >doesn't generate any errors, but the dataset that it creates, >'results.xls' is always empty. > >Essentially what I do, and what I want to do is this: I create many >datasets using PROC SQL. I then merge, sort, and do all kinds of >other good stuff to the data to create the final data set: data_fina. > I would then like to export this dataset, 'data_final' to excel. > >A collegue here at work gave me some code to use, and from this I have >written the following, which generates the empty excel files: > > >ods html file = 'C:\results.xls' > contents = 'data_final' > style = statdoc; > >[in here I have code that manipulates data and as an output creates >'data_final'] > >ods html close; > >Thanks for any and all help, > Hi, Mike,

"contents=" in ods html statement is to indicates the name of html file to where the table of contents should go. V8 online doc says:

CONTENTS= identifies the file that contains a table of contents to the HTML output. The contents file links to the body file.

What you probably want to do, if you want to print all the data in the dataset data_final is doing something like:

ods html file="c:\results.xls"; proc print data=data_final; run; ods html close;

Change the proc print with your favorate procedure. HTH

Cheers, Chang


Back to: Top of message | Previous page | Main SAS-L page