Your RECODE command is treating both Age and Age1 as if they are string variables. The error message suggests that Age is numeric. If Age *is* numeric, and if Age1 is also numeric (or does not exist yet), try this:
COMPUTE Age1 = Age-17.
CROSSTABS Age by Age1. /* Verify that it worked.
And if (for some reason that I can't imagine) Age1 has to be a String variable, use ALTER TYPE to change it.
ALTER TYPE Age1(A1).
I'm trying recode my age variables (ages 17-24) into new variables (0-7).
If Age is numeric then single quotes aren't needed. I hope this helps. Steve
Sent from my iPad
> On Jun 16, 2017, at 7:22 PM, leeshification <[hidden email]> wrote:
> I'm trying recode my age variables (ages 17-24) into new variables (0-7).
> I ran the following:
> RECODE Age ('17' = '0') ('18' = '1') ('19'= '2') ('20' = '3') ('21' = '4')
> ('22' = '5') ('23' = '6') ('24' = '7') INTO Age1.
> The following error shows up when I try to do so:
>> Error # 4655 in column 13. Text: 17
>> The RECODE command attempts to test a numeric value for having a string
>> Execution of this command stops.
> What am I doing wrong? Thanks so much!
> View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Trouble-Recoding-tp5734428.html > Sent from the SPSSX Discussion mailing list archive at Nabble.com.
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
For a list of commands to manage subscriptions, send the command