Date: Thu, 6 May 2010 11:58:35 -0300
Reply-To: SAS User <sasusr@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: SAS User <sasusr@GMAIL.COM>
Subject: Re: Complete a character variable with 0's
In-Reply-To: <BAY123-W190E630B4FFD69A0C53274DEF50@phx.gbl>
Content-Type: text/plain; charset=ISO-8859-1
Thanks guys (for all the fast answers), worked!
2010/5/6, toby dunn <tobydunn@hotmail.com>:
>
> Your looking for the Z format:
>
>
>
> X = Put( X , Z9. ) ;
>
>
>
> It left packs the sucker with leading zeros if there arent enough digits.
>
> Toby Dunn
>
> "Don't bail. The best gold is at the bottom of barrels of crap."
> Randy Pausch
>
> "Be prepared. Luck is where preparation meets opportunity."
> Randy Pausch
>
>
>
>
> > Date: Thu, 6 May 2010 11:38:02 -0300
> > From: sasusr@GMAIL.COM
> > Subject: Complete a character variable with 0's
> > To: SAS-L@LISTSERV.UGA.EDU
> >
> > Hello, what I think it was going to be easy to do it's becoming
> complicated.
> > I have a char variable with a phone number: for example 5544332. What I
> need
> > is to complete the number to have a lenght 9 with 0's at the beggining of
> > it.
> > How can I do? For example, for that number I need: 005544332, for
> 142312344
> > nothing, for 14231234 put 014231234, and so on.
> > Thanks,
> > Edf.
>
> _________________________________________________________________
> The New Busy is not the too busy. Combine all your e-mail accounts with
> Hotmail.
>
> http://www.windowslive.com/campaign/thenewbusy?tile=multiaccount&ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_4
|