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 (July 2002, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
=========================================================================
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,


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