Date: Tue, 22 Jul 1997 16:54:04 +0100
Reply-To: Jeremy Miles <J.N.V.Miles@DERBY.AC.UK>
Sender: "SPSSX(r) Discussion" <SPSSX-L@UGA.CC.UGA.EDU>
From: Jeremy Miles <J.N.V.Miles@DERBY.AC.UK>
Subject: Re: Generating random numbers
In-Reply-To: <c=US%a=_%p=VA%l=VBAVACO-970722145411Z-1595@vbaaustinhb.vba
.va.gov>
Content-Type: text/plain; charset="us-ascii"
At 10:54 22/07/97 -0400, Popovic, Jennifer, VBAVACO wrote:
>My dataset of 23000 cases has a variable for a unique identification
>number. Currently, about 3000 cases contain a system-missing value for
>that unique ID variable, but I need for each case to have a unique
>number for that variable.
[snip]
One of many:
Use autorecode, on your ID numbers, to ensure that you know the range of
your ID numbers.
AUTORECODE VARIABLES=ID /INTO NewID.
Then make each missing ID number equal to its case number ($casenum) + 23000.
IF (missing(newid)) newid = $casenum +23000.
Each will now have a unique number.
Autorecode again if you want the ID numbers to be sequential (1 through 23000).
===============================================================
Jeremy Miles, AVRU, Derby University, DE3 5GX Fax: 01332 622287
Tel: 01332 622222 x. 2146 j.n.v.miles@derby.ac.uk
======================No Space for a Joke======================