Date: Wed, 12 May 2004 13:26:41 -0400
Reply-To: Art@DrKendall.org
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Art Kendall <Arthur.Kendall@verizon.net>
Organization: Social Research Consultants
Subject: Re: Getting first 3 numbers of a numeric variable
In-Reply-To: <D85161511425D7119F9A00306E01B9B501F31B35@hob1s05.aaamich.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Cut-and-paste then run the syntax at the end of this message.
Does this do what you want? If not please restate your question in more
detail.
Hope this helps.
Art
Art@DrKendall.org
Social Research Consultants
University Park, MD USA
(301) 864-5570
new file.
input program.
loop id = 1 to 20.
compute x = rv.uniform(0, 16).
end case.
end loop.
end file.
end input program.
formats id (f4).
string y (a10).
numeric z(f3).
compute y = string(x,e10.3).
compute z= number(concat(substr(y,2,1),substr(y,4,2)),f3).
execute.
Abraham, Renji V. wrote:
>Hi,
>I have a numeric variable with a wide range of values. Now I want to create
>a new variable which would have only the first 3 numbers.
>For e.g.,
>
>12458 124
>5678 567
>125 125
>8458563 845
>
>I would really appreciate your help. Thanks.
>
>Renji
>
>
>
|