Date: Fri, 19 Jul 2002 14:30:51 -0400
Reply-To: Cathy Ward <cward@NCACCESSCARE.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Cathy Ward <cward@NCACCESSCARE.ORG>
Subject: Numeric to Character Conversion with Leading Zeros
Content-Type: text/plain; charset="us-ascii"
I have a table of 11 digit numeric NDC codes, with leading zeros, which
was created by code containing the following:
data epoc_amml_S (keep = NDC_No);
format NDC_No Z11.;
NDC_No = put (NDC, 11.);
I'd now like to add a column where the NDC code is converted to a
character string, rather than a number, for use in exporting to MS
Access. I've tried the following code and end up with a character
variable where leading zeros have turned into blanks. How can I have
SAS read my numeric string literally and keep my leading zeros or pad
the new character value with zeros?
format NDC_Char $char11.;
NDC_Char = input (NDC_No, $char11.);
Any suggestions would be much appreciated.
Thanks in advance,