f



Variable name contains an illegal character

Hi All,

I'm using SPSS 17, and I'm having problems pasting variable names from
a list (column) in excel to the variable name column in SPSS. I keep
getting the following error message: "Variable name contains an
illegal character". But there are no illegal characters involved!
Further, it will not give me this error message if I try to paste only
a small number of variable names (e.g., 2 names).

This is something that I have routinely used in the past with v. 15
with no problems. Indeed, if I use the same excel file with the same
names, it will paste perfectly with version 15, but will not with
version 17.

Also, this problem doesn't seem to be consistent. Sometimes it will
work ok, others not.

Any thoughts? I'm losing my mind here.

Thanks!

Mary
0
marybetholiver
1/29/2009 10:07:27 PM
comp.soft-sys.stat.spss 5679 articles. 0 followers. Post Follow

7 Replies
4220 Views

Similar Articles

[PageSpeed] 20

On Jan 29, 5:07=A0pm, "marybetholi...@gmail.com"
<marybetholi...@gmail.com> wrote:
> Hi All,
>
> I'm using SPSS 17, and I'm having problems pasting variable names from
> a list (column) in excel to the variable name column in SPSS.

What is the "variable name column" in SPSS?  Do you mean in the
Variable View tab of the Data Editor?

> I keep
> getting the following error message: "Variable name contains an
> illegal character". But there are no illegal characters involved!

But apparently there are.

> Further, it will not give me this error message if I try to paste only
> a small number of variable names (e.g., 2 names).
>
> This is something that I have routinely used in the past with v. 15
> with no problems. Indeed, if I use the same excel file with the same
> names, it will paste perfectly with version 15, but will not with
> version 17.
>
> Also, this problem doesn't seem to be consistent. Sometimes it will
> work ok, others not.
>
> Any thoughts? I'm losing my mind here.
>
> Thanks!
>
> Mary

Perhaps if you explain why you're pasting variable names into SPSS,
someone can suggest an alternative way of accomplishing your goal. If
the point is to rename the variables in an existing file, for example,
you could do that with a RENAME VARIABLES command:

RENAME VARIABLES (list of current names =3D list of new names).

The list of current names can be pasted via the "Variables" tool (the
button has an icon of a data table with a red question mark beside
it), and the new names can be pasted from Excel.

--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/
"When all else fails, RTFM."
0
Bruce
1/29/2009 11:11:30 PM
Hello Bruce,

Thanks. But I'm afraid that I have just learned from SPSS in a phone
conversation that the problem is the following: "It's a bug."

I like to create variable names in excel because it's efficient. For
example, let's say I have an 18-item scale that assesses need for
cognition. I might like to name these variables nfc1, nfc2,...nfc18.
In excel I can create these names immediately by staring with the
first two names, nfc1 and nfc2, and then dragging down the column.

Likewise, sometimes I collect data online. It's very efficient to copy
the names of the form items in html into excel, then I can quickly
paste them into SPSS.

Let me reiterate, though, this this happens *and there are no illegal
characters* in the variable names. I can further demonstrate this
because I can open a file in SPSS that already has the variables in
place. If I were to want to copy some of the variable names from that
file into a new SPSS file, I get the same error message.

SPSS told me that "they are aware" of the problem and will try to
address it in the next patch.

For the life of me, I don't know why I let go of v. 15. I should have
learned my lesson after seeing v. 16.

Best,

Mary


On Jan 29, 6:11=A0pm, Bruce Weaver <bwea...@lakeheadu.ca> wrote:
> On Jan 29, 5:07=A0pm, "marybetholi...@gmail.com"
>
> <marybetholi...@gmail.com> wrote:
> > Hi All,
>
> > I'm using SPSS 17, and I'm having problems pasting variable names from
> > a list (column) in excel to the variable name column in SPSS.
>
> What is the "variable name column" in SPSS? =A0Do you mean in the
> Variable View tab of the Data Editor?
>
> > I keep
> > getting the following error message: "Variable name contains an
> > illegal character". But there are no illegal characters involved!
>
> But apparently there are.
>
>
>
> > Further, it will not give me this error message if I try to paste only
> > a small number of variable names (e.g., 2 names).
>
> > This is something that I have routinely used in the past with v. 15
> > with no problems. Indeed, if I use the same excel file with the same
> > names, it will paste perfectly with version 15, but will not with
> > version 17.
>
> > Also, this problem doesn't seem to be consistent. Sometimes it will
> > work ok, others not.
>
> > Any thoughts? I'm losing my mind here.
>
> > Thanks!
>
> > Mary
>
> Perhaps if you explain why you're pasting variable names into SPSS,
> someone can suggest an alternative way of accomplishing your goal. If
> the point is to rename the variables in an existing file, for example,
> you could do that with a RENAME VARIABLES command:
>
> RENAME VARIABLES (list of current names =3D list of new names).
>
> The list of current names can be pasted via the "Variables" tool (the
> button has an icon of a data table with a red question mark beside
> it), and the new names can be pasted from Excel.
>
> --
> Bruce Weaver
> bwea...@lakeheadu.cahttp://sites.google.com/a/lakeheadu.ca/bweaver/
> "When all else fails, RTFM."

0
marybetholiver
1/29/2009 11:28:43 PM
marybetholiver@gmail.com wrote:
> Hello Bruce,
> 
> Thanks. But I'm afraid that I have just learned from SPSS in a phone
> conversation that the problem is the following: "It's a bug."
> 
> I like to create variable names in excel because it's efficient. For
> example, let's say I have an 18-item scale that assesses need for
> cognition. I might like to name these variables nfc1, nfc2,...nfc18.
> In excel I can create these names immediately by staring with the
> first two names, nfc1 and nfc2, and then dragging down the column.

It's also very easy in SPSS syntax.  E.g.,

numeric nfc1 to nfc18 (f5.0).
exe.


> 
> Likewise, sometimes I collect data online. It's very efficient to copy
> the names of the form items in html into excel, then I can quickly
> paste them into SPSS.

As I said in my earlier post, you could just as easily paste them 
into a RENAME VARIABLES command.  But it sounds like you are not a 
syntax user.

> 
> Let me reiterate, though, this this happens *and there are no illegal
> characters* in the variable names. I can further demonstrate this
> because I can open a file in SPSS that already has the variables in
> place. If I were to want to copy some of the variable names from that
> file into a new SPSS file, I get the same error message.
> 
> SPSS told me that "they are aware" of the problem and will try to
> address it in the next patch.
> 
> For the life of me, I don't know why I let go of v. 15. I should have
> learned my lesson after seeing v. 16.
> 
> Best,
> 
> Mary

-- 
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/
"When all else fails, RTFM."
0
Bruce
1/30/2009 1:20:18 AM
On Jan 29, 6:20=A0pm, Bruce Weaver <bwea...@lakeheadu.ca> wrote:
> marybetholi...@gmail.com wrote:
> > Hello Bruce,
>
> > Thanks. But I'm afraid that I have just learned from SPSS in a phone
> > conversation that the problem is the following: "It's a bug."
>
> > I like to create variable names in excel because it's efficient. For
> > example, let's say I have an 18-item scale that assesses need for
> > cognition. I might like to name these variables nfc1, nfc2,...nfc18.
> > In excel I can create these names immediately by staring with the
> > first two names, nfc1 and nfc2, and then dragging down the column.
>
> It's also very easy in SPSS syntax. =A0E.g.,
>
> numeric nfc1 to nfc18 (f5.0).
> exe.
>
>
>
> > Likewise, sometimes I collect data online. It's very efficient to copy
> > the names of the form items in html into excel, then I can quickly
> > paste them into SPSS.
>
> As I said in my earlier post, you could just as easily paste them
> into a RENAME VARIABLES command. =A0But it sounds like you are not a
> syntax user.
>
>
>
>
>
> > Let me reiterate, though, this this happens *and there are no illegal
> > characters* in the variable names. I can further demonstrate this
> > because I can open a file in SPSS that already has the variables in
> > place. If I were to want to copy some of the variable names from that
> > file into a new SPSS file, I get the same error message.
>
> > SPSS told me that "they are aware" of the problem and will try to
> > address it in the next patch.
>
> > For the life of me, I don't know why I let go of v. 15. I should have
> > learned my lesson after seeing v. 16.
>
> > Best,
>
> > Mary
>
> --
> Bruce Weaver
> bwea...@lakeheadu.cahttp://sites.google.com/a/lakeheadu.ca/bweaver/
> "When all else fails, RTFM."

I just received notification 10 minutes ago that this bug has been
resolved for the next maintenance release.  (I can't comment on the
release date for that at this time.)

Regards,
Jon Peck
0
JKPeck
1/30/2009 3:37:42 AM
Thanks Jon, very helpful. I use syntax extensively, but knowing that
the bug in the program will be resolved will be helpful.

Kind regards,

Mary
0
marybetholiver
1/30/2009 2:18:11 PM
Presumably if you have a list of variables in one column, say A, you
could add in a formula to another column, eg

=3D"COMPUTE " & A1 & "=3D-1."

Which you could use to create a block of syntax to create the
variables that way, and then in spss add in a recode for -1 to sysmis.
It would be a way round your current problem.

Fred



On Jan 30, 2:18=A0pm, "marybetholi...@gmail.com"
<marybetholi...@gmail.com> wrote:
> Thanks Jon, very helpful. I use syntax extensively, but knowing that
> the bug in the program will be resolved will be helpful.
>
> Kind regards,
>
> Mary

0
fred
2/2/2009 10:56:26 AM
On Friday, January 30, 2009 at 12:07:27 AM UTC+2, marybet...@gmail.com wrote:
> Hi All,
> 
> I'm using SPSS 17, and I'm having problems pasting variable names from
> a list (column) in excel to the variable name column in SPSS. I keep
> getting the following error message: "Variable name contains an
> illegal character". But there are no illegal characters involved!
> Further, it will not give me this error message if I try to paste only
> a small number of variable names (e.g., 2 names).
> 
> This is something that I have routinely used in the past with v. 15
> with no problems. Indeed, if I use the same excel file with the same
> names, it will paste perfectly with version 15, but will not with
> version 17.
> 
> Also, this problem doesn't seem to be consistent. Sometimes it will
> work ok, others not.
> 
> Any thoughts? I'm losing my mind here.
> 
> Thanks!
> 
> Mary

Don't use 'Space'  in between variable names and dont start variable name with numbers thats it 
sometimes spss do not accept capital letters ... i don't know why.. but it works 
1
allthewaytogalaxy
4/8/2015 9:26:05 AM
Reply: