LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 6 Feb 2004 10:58:46 -0500
Reply-To:     "Michael L. Davis" <michael@BASSETTCONSULTING.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Michael L. Davis" <michael@BASSETTCONSULTING.COM>
Subject:      Re: ODS HTML to Excel
Content-Type: text/plain; charset="us-ascii"; format=flowed

Hello Sheila and other SAS-L Friends,

From a birdie.

- Michael "Mad Doggy" Davis

>One solution is to have ODS assign an Excel format to the column when it >generates the HTML output. The general technique is described in >http://www2.sas.com/proceedings/sugi28/052-28.pdf > >This code will cause the data to be read into Excel as text fields: > >ods html file='test.html'; >proc print data=test; > var var1 / style(data)={htmlstyle="mso-number-format:\@"}; >run; >ods html close; > >Excel formats assigned in this way are ignored by Web browsers, so you can >safely view the HTML file in Excel OR your favorite Web browser; there is >no need to make file for the Web and another file for Excel. > > >------- Original Message ------- > >Date: Thu, 5 Feb 2004 05:43:40 -0800 >From: Sheila Whitelaw <whitelaw70@HOTMAIL.COM> >Subject: ODS HTML to Excel > >Hi, I generated an output using ODS HTML and then opened the HTML file in >Excel. Excel defaulted the field as numeric and somehow set the last two >digits as zeros. Does anyone know how to fix it? Following is my code and >the outputs. > >Program: >data test; >infile cards; >input var1 $17.; >cards; >10003010960234567 >10030109602345670 >10301096023456701 >13010960234567012 >30109602345670123 >11096023456701234 >10960234567012345 >19602345670123456 >96023456701234567 >; >run; >ods html file='test.html'; >proc print data=test; >run; >ods html close; >run; > >LST output: >Obs var1 > > 1 10003010960234567 > 2 10030109602345670 > 3 10301096023456701 > 4 13010960234567012 > 5 30109602345670123 > 6 11096023456701234 > 7 10960234567012345 > 8 19602345670123456 > 9 96023456701234567 > >HTML output viewed in Excel >Obs var1 >1 10003010960234500 >2 10030109602345600 >3 10301096023456700 >4 13010960234567000 >5 30109602345670100 >6 11096023456701200 >7 10960234567012300 >8 19602345670123400 >9 96023456701234500 > >Any help would be appreciated. > >Thanks. > >Sheila.

Michael L. Davis Vice President Bassett Consulting Services, Inc. 10 Pleasant Drive North Haven CT 06473-3712 E-Mail: michael@bassettconsulting.com Web: http://www.bassettconsulting.com Telephone: 203-562-0640


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