Autorecode

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Autorecode

Jean Hanson
Hello again,
Is there a way with autorecode to change a string variable to a numeric variable and have it retain the same variable name and not assign a new variable name?
Thanks,
Jean Hanson
Reply | Threaded
Open this post in threaded view
|

Re: Autorecode

Hector Maletta
         No, no way. But you can change the name of the original string
variable with the RENAME VARIABLE command, and then recode that string
variable to a new numeric variable with the old name. Example:

         RENAME VARIABLE (oldname=newname).
         AUTORECODE newname /INTO oldname.

         If the string variable contains only numbers in text format, you
can use RECODE with the CONVERT keyword, as in:

         RECODE newname (CONVERT) INTO oldname.

         Hector

         -----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Jean Hanson
Sent: 23 August 2007 23:21
To: [hidden email]
Subject: Autorecode

         Hello again,
         Is there a way with autorecode to change a string variable to a
numeric variable and have it retain the same variable name and not assign a
new variable name?
         Thanks,
         Jean Hanson