=========================================================================
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>
Organization: AccessCare
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.;
set epoc_amml;
NDC_No = put (NDC, 11.);
run;
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?
data epoc_amml_S2;
format NDC_Char $char11.;
set epoc_amml_S;
NDC_Char = input (NDC_No, $char11.);
run;
Any suggestions would be much appreciated.
Thanks in advance,
|