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 (May 2004, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 19 May 2004 11:14:54 -0400
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: ODS HTML to Excel
Comments:   To: Dennis Danforth <DDanforth@BBANDT.COM>

On Wed, 19 May 2004 10:50:40 -0400, Danforth, Dennis <DDanforth@BBANDT.COM> wrote:

>Hi all, > >I have sixteen digit account number in a character field that I frequently >export to Excel. If I use ODS HTML, when I open the output Excel sees the >field as numeric and automatically converts the account number into exponent >format. > >Does anyone have any quick ideas of how to ensure Excel treats the field as >character? > >data my_data; > account_num = '1234567890123456'; >run; > >ods html body='c:\temp\my_output.xls'; > >proc print; >run; > >ods html close;

Hi, Dennis,

If it is acceptable to add one blank character at the end of account_num in excel, then try the following. It creates the my_output.xls file in your current work directory.

Cheers, Chang

data my_data;

account_num = '1234567890123456';

length new_account_num $%eval(16+6).; retain nbsp '&nbsp;'; drop nbsp; new_account_num = account_num || nbsp; run;

x cd %sysfunc(pathname(work)); /* Lou^s cool x cd trick! */ ods html body='my_output.xls'; proc print; run; ods html close;


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