Date: Thu, 6 Jul 2006 14:31:03 -0400
Reply-To: Keith McCormick <firstname.lastname@example.org>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Keith McCormick <email@example.com>
Subject: Re: typecasting
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
COMPUTE numb = number(VAR1,f2.0) . that should take care of the second one.
reading between the lines, you might need to add leading zeros, or
spaces so for the first one the solution would also be a function with
COMPUTE, namely LPAD (or maybe RPAD).
On 7/6/06, besheer mohamed <firstname.lastname@example.org> wrote:
> Does anyone know how to do either of these in one line?
> 1) widen a string (say from length 4 to 6)
> 2) convert a string to a number.
> I know you can do either of these if you're willing to ...
> a) create a temp variable of the desired type/length b) copy the data from the old variable to the temp variable c) delete the old variable d) recreate the old variable as the desired type/length e) copy the data from the temp variable into the recreated variable and f) delete the temp variable...
> but that's insane. Is there an easier way to do either of these actions?
> Yahoo! Music Unlimited - Access over 1 million songs.Try it free.