LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2004)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 12 May 2004 13:26:41 -0400
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Art Kendall <>
Organization: Social Research Consultants
Subject:      Re: Getting first 3 numbers of a numeric variable
Comments: To: "Abraham, Renji V." <>
In-Reply-To:  <>
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 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 > > >

Back to: Top of message | Previous page | Main SPSSX-L page