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 (September 2007, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
In-Reply-To:  A<005101c7fc89$d1d513f0$0815c79d@wks.tsh.thomson.com>
Content-Type: text/plain; charset="US-ASCII"

Try prepending a single quote character to your values, e.g., '04244.

-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Bruce J Sent: Friday, September 21, 2007 12:59 PM To: SAS-L@LISTSERV.UGA.EDU 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 ODS.

Here is a sample of code:

data sales; length zip $5 sales 8; input zip $ sales; cards; 10213 44943934 04244 43431331 08532 24985771 90201 69492134 ; run; ods html file="c:\temp\sales.xls"; proc print data=sales; run; ods html close;


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