unstrung over string variable

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

unstrung over string variable

Tanya Temkin
I wish I had more interesting problem to present but this is just annoying
the #$%! out of me. Sometimes it's the "simple" things that get you....

I have a nice string variable that I brought in from Excel called CA_CON,
with two values CA (for case) and CO (for control). Each record in the
file is coded as CA or CO. Whenever I try to do the simplest thing like
set up IF statements or resort to the good old GUI to select cases with a
value of CA or CO, I get this love poem from SPSS (v14.0, on Windows):

"Incorrect variable name: either the name is more than 64 characters; or
it is not defined by a previous command."

Yeah, well we can see the variable isn?t 64 characters long, it already
exists, when I go DISPLAY VARIABLES all its attributes are displayed,
there aren?t any blank spaces before or after the variable name; I?ve
renamed the variable in variable viewer to CASE_CNTRL but same thing.still
happens.

What?s up here? What tree is getting in the way of my seeing the forest?

Thanks

Tanya

NOTICE TO RECIPIENT:  If you are not the intended recipient of this
e-mail, you are prohibited from sharing, copying, or otherwise using or
disclosing its contents.  If you have received this e-mail in error,
please notify the sender immediately by reply e-mail and permanently
delete this e-mail and any attachments without reading, forwarding or
saving them.  Thank you.
Reply | Threaded
Open this post in threaded view
|

Re: unstrung over string variable

Oliver, Richard
My guess is that you're not quoting the string values. For example:

IF CA_CON = CA...etc.

would treat CA as a variable name and assume that you are comparing the value of variable CA_CON to the value of variable CA, and the latter doesn't exist. Hence the error message.

OTOH:

IF CA_CON = "CA"...etc.

would interpret "CA" as a possible value of CA_CON.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Tanya Temkin
Sent: Friday, March 16, 2007 10:23 AM
To: [hidden email]
Subject: unstrung over string variable

I wish I had more interesting problem to present but this is just annoying
the #$%! out of me. Sometimes it's the "simple" things that get you....

I have a nice string variable that I brought in from Excel called CA_CON,
with two values CA (for case) and CO (for control). Each record in the
file is coded as CA or CO. Whenever I try to do the simplest thing like
set up IF statements or resort to the good old GUI to select cases with a
value of CA or CO, I get this love poem from SPSS (v14.0, on Windows):

"Incorrect variable name: either the name is more than 64 characters; or
it is not defined by a previous command."

Yeah, well we can see the variable isn?t 64 characters long, it already
exists, when I go DISPLAY VARIABLES all its attributes are displayed,
there aren?t any blank spaces before or after the variable name; I?ve
renamed the variable in variable viewer to CASE_CNTRL but same thing.still
happens.

What?s up here? What tree is getting in the way of my seeing the forest?

Thanks

Tanya

NOTICE TO RECIPIENT:  If you are not the intended recipient of this
e-mail, you are prohibited from sharing, copying, or otherwise using or
disclosing its contents.  If you have received this e-mail in error,
please notify the sender immediately by reply e-mail and permanently
delete this e-mail and any attachments without reading, forwarding or
saving them.  Thank you.