syntax problem

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

syntax problem

Scott Collier
Greetings,

I am trying to use the following syntax to compute variable Z which is
simply the difference between pre and post tests:

DO REPEAT
  X = Q1 TO Q31/
  Y = Post1 TO Post31/
  Z = diff1 TO diff31.
COMPUTE Z = (X-Y).
End Repeat.

I keep getting the error that says:

>Error # 4511 in column 256.  Text: (End of Command)
>The number of elements in variable and value lists do not agree in number
>with a previous variable or value list(s).
>This command not executed.

I don't see any differences in the numbers...anyone able to help out?
There are 31 of each.

Thanks in advance.

Scott

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: syntax problem

David Futrell
Scott,

Are Q1 to Q31 and Post1 to Post31 arranged consecutively in the data file? If you have other variables in there, SPSS will "count" them and cause this error.

If this is the case, you could rearrange the data file or explicitly list Q1,Q2,Q3, etc. in the "Do Repeat" statement.

Scott Collier <[hidden email]> wrote: Greetings,

I am trying to use the following syntax to compute variable Z which is
simply the difference between pre and post tests:

DO REPEAT
  X = Q1 TO Q31/
  Y = Post1 TO Post31/
  Z = diff1 TO diff31.
COMPUTE Z = (X-Y).
End Repeat.

I keep getting the error that says:

>Error # 4511 in column 256.  Text: (End of Command)
>The number of elements in variable and value lists do not agree in number
>with a previous variable or value list(s).
>This command not executed.

I don't see any differences in the numbers...anyone able to help out?
There are 31 of each.

Thanks in advance.

Scott

=====================
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



---------------------------------
Never miss a thing.   Make Yahoo your homepage.

=====================
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
Reply | Threaded
Open this post in threaded view
|

Re: syntax problem

Norton, John
In reply to this post by Scott Collier
I think the source of the problem rests with your definition of Z, which should be diff1 TO diff3.  Now it reads diff1 TO diff31, and therein lies the disagreement in number.
 
HTH,
 
John Norton

________________________________

From: SPSSX(r) Discussion on behalf of Scott Collier
Sent: Wed 3/19/2008 12:53 PM
To: [hidden email]
Subject: syntax problem



Greetings,

I am trying to use the following syntax to compute variable Z which is
simply the difference between pre and post tests:

DO REPEAT
  X = Q1 TO Q31/
  Y = Post1 TO Post31/
  Z = diff1 TO diff31.
COMPUTE Z = (X-Y).
End Repeat.

I keep getting the error that says:

>Error # 4511 in column 256.  Text: (End of Command)
>The number of elements in variable and value lists do not agree in number
>with a previous variable or value list(s).
>This command not executed.

I don't see any differences in the numbers...anyone able to help out?
There are 31 of each.

Thanks in advance.

Scott

=====================
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
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: syntax problem

King Douglas
In reply to this post by David Futrell
Given that Q1 to Q31 and Post1 to Post 31 are contiguous in the data file, try using two digits as the starting point for the "Z" numbering scheme:

DO REPEAT
  X = Q1 TO Q31/
  Y = Post1 TO Post31/
  Z = diff01 TO diff31.
COMPUTE Z = (X-Y).
End Repeat.

King Douglas
American Airlines Customer Research

David Futrell <[hidden email]> wrote: Scott,

Are Q1 to Q31 and Post1 to Post31 arranged consecutively in the data file? If you have other variables in there, SPSS will "count" them and cause this error.

If this is the case, you could rearrange the data file or explicitly list Q1,Q2,Q3, etc. in the "Do Repeat" statement.

Scott Collier  wrote: Greetings,

I am trying to use the following syntax to compute variable Z which is
simply the difference between pre and post tests:

DO REPEAT
  X = Q1 TO Q31/
  Y = Post1 TO Post31/
  Z = diff1 TO diff31.
COMPUTE Z = (X-Y).
End Repeat.

I keep getting the error that says:

>Error # 4511 in column 256.  Text: (End of Command)
>The number of elements in variable and value lists do not agree in number
>with a previous variable or value list(s).
>This command not executed.

I don't see any differences in the numbers...anyone able to help out?
There are 31 of each.

Thanks in advance.

Scott

=====================
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



---------------------------------
Never miss a thing.   Make Yahoo your homepage.

=====================
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
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: syntax problem

David Wasserman
In reply to this post by Scott Collier
If the variables are existing variables, the TO convention will include all
variables in the data set between the first listed and the last listed.  For
your syntax to work, variables Q1 to Q31 must be adjacent in the data, and
so must variables Post1 to Post31.  If they are arranged (for example) Q1
Post1 Q2 Post2 etc., the syntax Q1 TO Q31 will include Q1, Post1, Q2, Post2
. . . Post30, Q31.


David Wasserman
Educational Data Consultant


-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Scott Collier
Sent: March-19-08 11:54 AM
To: [hidden email]
Subject: syntax problem

Greetings,

I am trying to use the following syntax to compute variable Z which is
simply the difference between pre and post tests:

DO REPEAT
  X = Q1 TO Q31/
  Y = Post1 TO Post31/
  Z = diff1 TO diff31.
COMPUTE Z = (X-Y).
End Repeat.

I keep getting the error that says:

>Error # 4511 in column 256.  Text: (End of Command)
>The number of elements in variable and value lists do not agree in number
>with a previous variable or value list(s).
>This command not executed.

I don't see any differences in the numbers...anyone able to help out?
There are 31 of each.

Thanks in advance.

Scott

=====================
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
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: syntax problem

Oliver, Richard
In reply to this post by Norton, John
Umm...no, I don't think so. I think all three variables lists APPEAR to be equal in length, using the general form var1 to var31. I would guess the problem is that either Q1 to Q31 or Post1 to Post31 actually define a list that has either more or fewer than 31 variables. For example, in this context, "Q1 TO Q31" only means Q1, Q2, Q3...Q31 if those variables are all contiguous in file order. If there are any other variables between Q1 and Q31 (or some of the Q variables are somewhere else), then "Q1 TO Q31" defines something different than what you might think it defines. In other words, "Q1" defines a starting position in file order, and "Q31" defines an ending position in file order.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Norton, John
Sent: Wednesday, March 19, 2008 1:12 PM
To: [hidden email]
Subject: Re: syntax problem

I think the source of the problem rests with your definition of Z, which should be diff1 TO diff3.  Now it reads diff1 TO diff31, and therein lies the disagreement in number.

HTH,

John Norton

________________________________

From: SPSSX(r) Discussion on behalf of Scott Collier
Sent: Wed 3/19/2008 12:53 PM
To: [hidden email]
Subject: syntax problem



Greetings,

I am trying to use the following syntax to compute variable Z which is
simply the difference between pre and post tests:

DO REPEAT
  X = Q1 TO Q31/
  Y = Post1 TO Post31/
  Z = diff1 TO diff31.
COMPUTE Z = (X-Y).
End Repeat.

I keep getting the error that says:

>Error # 4511 in column 256.  Text: (End of Command)
>The number of elements in variable and value lists do not agree in number
>with a previous variable or value list(s).
>This command not executed.

I don't see any differences in the numbers...anyone able to help out?
There are 31 of each.

Thanks in advance.

Scott

=====================
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
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
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: syntax problem

Norton, John
My mistake.  
 
Thanks for the clarification.
 
JN
(I'll be making that eye appointment now).

 
________________________________

From: Oliver, Richard
Sent: Wed 3/19/2008 1:45 PM
To: Norton, John; [hidden email]
Subject: RE: Re: syntax problem



Umm...no, I don't think so. I think all three variables lists APPEAR to be equal in length, using the general form var1 to var31. I would guess the problem is that either Q1 to Q31 or Post1 to Post31 actually define a list that has either more or fewer than 31 variables. For example, in this context, "Q1 TO Q31" only means Q1, Q2, Q3...Q31 if those variables are all contiguous in file order. If there are any other variables between Q1 and Q31 (or some of the Q variables are somewhere else), then "Q1 TO Q31" defines something different than what you might think it defines. In other words, "Q1" defines a starting position in file order, and "Q31" defines an ending position in file order.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Norton, John
Sent: Wednesday, March 19, 2008 1:12 PM
To: [hidden email]
Subject: Re: syntax problem

I think the source of the problem rests with your definition of Z, which should be diff1 TO diff3.  Now it reads diff1 TO diff31, and therein lies the disagreement in number.


HTH,
 
John Norton

________________________________

From: SPSSX(r) Discussion on behalf of Scott Collier
Sent: Wed 3/19/2008 12:53 PM
To: [hidden email]
Subject: syntax problem



Greetings,

I am trying to use the following syntax to compute variable Z which is
simply the difference between pre and post tests:

DO REPEAT
  X = Q1 TO Q31/
  Y = Post1 TO Post31/
  Z = diff1 TO diff31.
COMPUTE Z = (X-Y).
End Repeat.

I keep getting the error that says:

>Error # 4511 in column 256.  Text: (End of Command)
>The number of elements in variable and value lists do not agree in number
>with a previous variable or value list(s).
>This command not executed.

I don't see any differences in the numbers...anyone able to help out?
There are 31 of each.

Thanks in advance.

Scott

=====================
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
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
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: syntax problem

Oliver, Richard
In reply to this post by King Douglas
That shouldn't be necessary. DO REPEAT should correctly expand Vn to Vnn or even Vn to Vnnnnn for creating new variables.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of King Douglas
Sent: Wednesday, March 19, 2008 1:30 PM
To: [hidden email]
Subject: Re: syntax problem

Given that Q1 to Q31 and Post1 to Post 31 are contiguous in the data file, try using two digits as the starting point for the "Z" numbering scheme:

DO REPEAT
  X = Q1 TO Q31/
  Y = Post1 TO Post31/
  Z = diff01 TO diff31.
COMPUTE Z = (X-Y).
End Repeat.

King Douglas
American Airlines Customer Research

David Futrell <[hidden email]> wrote: Scott,

Are Q1 to Q31 and Post1 to Post31 arranged consecutively in the data file? If you have other variables in there, SPSS will "count" them and cause this error.

If this is the case, you could rearrange the data file or explicitly list Q1,Q2,Q3, etc. in the "Do Repeat" statement.

Scott Collier  wrote: Greetings,

I am trying to use the following syntax to compute variable Z which is
simply the difference between pre and post tests:

DO REPEAT
  X = Q1 TO Q31/
  Y = Post1 TO Post31/
  Z = diff1 TO diff31.
COMPUTE Z = (X-Y).
End Repeat.

I keep getting the error that says:

>Error # 4511 in column 256.  Text: (End of Command)
>The number of elements in variable and value lists do not agree in number
>with a previous variable or value list(s).
>This command not executed.

I don't see any differences in the numbers...anyone able to help out?
There are 31 of each.

Thanks in advance.

Scott

=====================
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



---------------------------------
Never miss a thing.   Make Yahoo your homepage.

=====================
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
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
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: syntax problem

King Douglas
Richard,

 "Shouldn't" in a perfect world.  Being an old guy, I've seen many cases where such a simple modification solves problems that shouldn't be.

 Let's see if my suggestion works.

 Cheers!

 King

"Oliver, Richard" <[hidden email]> wrote: That shouldn't be necessary. DO REPEAT should correctly expand Vn to Vnn or even Vn to Vnnnnn for creating new variables.

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of King Douglas
Sent: Wednesday, March 19, 2008 1:30 PM
To: [hidden email]
Subject: Re: syntax problem

Given that Q1 to Q31 and Post1 to Post 31 are contiguous in the data file, try using two digits as the starting point for the "Z" numbering scheme:

DO REPEAT
  X = Q1 TO Q31/
  Y = Post1 TO Post31/
  Z = diff01 TO diff31.
COMPUTE Z = (X-Y).
End Repeat.

King Douglas
American Airlines Customer Research

David Futrell  wrote: Scott,

Are Q1 to Q31 and Post1 to Post31 arranged consecutively in the data file? If you have other variables in there, SPSS will "count" them and cause this error.

If this is the case, you could rearrange the data file or explicitly list Q1,Q2,Q3, etc. in the "Do Repeat" statement.

Scott Collier  wrote: Greetings,

I am trying to use the following syntax to compute variable Z which is
simply the difference between pre and post tests:

DO REPEAT
  X = Q1 TO Q31/
  Y = Post1 TO Post31/
  Z = diff1 TO diff31.
COMPUTE Z = (X-Y).
End Repeat.

I keep getting the error that says:

>Error # 4511 in column 256.  Text: (End of Command)
>The number of elements in variable and value lists do not agree in number
>with a previous variable or value list(s).
>This command not executed.

I don't see any differences in the numbers...anyone able to help out?
There are 31 of each.

Thanks in advance.

Scott

=====================
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



---------------------------------
Never miss a thing.   Make Yahoo your homepage.

=====================
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
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
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD