|
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 ' ';
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;
|