Date: Thu, 25 Aug 2011 13:20:14 -0500
Reply-To: Joe Matise <snoopy369@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Joe Matise <snoopy369@GMAIL.COM>
Subject: Re: Adding 0s in front of character variables
In-Reply-To: <201108251808.p7PAtrMG017138@willow.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
charvar = put(numvar,Z6.);
would zero-pad it to 6 digits long regardless of its initial length.
-Joe
On Thu, Aug 25, 2011 at 1:08 PM, <sas8832@hotmail.co.uk> wrote:
> Hello
>
> I would a character id variable. I would like to add two 0s before a four
> digit id variable and one 0 before a five digit id variable. Any
> suggestions?
>
> Thanks
>
|