Date: Fri, 16 Sep 2005 08:10:30 -0700
Reply-To: Toby <tobydunn@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Toby <tobydunn@HOTMAIL.COM>
Subject: Re: pre-pending zeros
Content-Type: text/plain; charset="iso-8859-1"
data one ;
infile cards ;
input x $6. ;
data two ;
set one ;
y = translate(substr(right(x),4,3),'0',' ') ;
proc print ;
I got stuck in a situation.
There is a variable defined as character and the length of that
variable is 6.
Now I want to take the last 3 character only and for that I can use the
but if the variable length is less than 3 then pre pend that with the
so the output should look like this.
When I tried then I messed up at the numeric to character things and
preprnding zero don't work.
Thank you in the advance