Date: Fri, 21 Sep 2007 13:42:13 -0700
Reply-To: "Pardee, Roy" <pardee.r@GHC.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Pardee, Roy" <pardee.r@GHC.ORG>
Subject: Re: How to make Excel treat a numeric like a character
Content-Type: text/plain; charset="US-ASCII"
Try prepending a single quote character to your values, e.g., '04244.
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Sent: Friday, September 21, 2007 12:59 PM
Subject: How to make Excel treat a numeric like a character
Hi! I'm hoping that this is an easy one...
I have a table that has a field that is filled with numbers, but needs
to be stored as a character field, because of valid leading zeros. My
problem comes when I try converting this file into Excel. When Excel
sees a number, it automatically converts the column to a number. What
can I use to avoid this "feature"? We don't have Access for PC File
Formats installed on our server, so I can't use that. I'm trying to use
Here is a sample of code:
length zip $5 sales 8;
input zip $ sales;
ods html file="c:\temp\sales.xls";
proc print data=sales;
ods html close;