variable name specification oddity on crosstabs

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

variable name specification oddity on crosstabs

Maguin, Eugene

I run across something in the crosstabs command that seems unexplainably odd.

Var1 is A5, zeros is f3.

This statement: crosstabs var1 by zeros.

Yields an error (in part):

Text: by Command: crosstabs

Unrecognized text was found where a variable list was expected.

Execution of this command stops.

 

However, from the menu:

CROSSTABS  /TABLES=var1 BY zeros  /FORMAT=AVALUE TABLES  /CELLS=COUNT  /COUNT ROUND CELL.

Run fine. And the edited text runs fine.

CROSSTABS  /TABLES=var1 BY zeros.

 

So, the command processor is not recognizing “var1” as a named variable. It also won’t recognize “var2”, “var10”, “var1a”, but “table” works fine.

 

Gene Maguin

===================== 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: variable name specification oddity on crosstabs

Jon Peck
If you look at the syntax chart for CROSSTABS, you see this (partial extract)

General mode:
CROSSTABS [TABLES=]varlist BY varlist [BY...] [/varlist...]

Integer mode :
CROSSTABS VARIABLES=varlist(min,max) [varlist...]
/TABLES=varlist BY varlist [BY...] [/varlist...]

Now, in olden times, three-character abbreviation in syntax was allowed, and this is still allowed for commands that existed at the time the rule was changed.  So VAR is recognized as the keyword VARIABLES in INTEGER mode even if you wrote it as var1 or similar.

It's sloppy parsing, but it is easy to avoid by using the TABLES keyword.  It was never corrected as modern is always to use /TABLES, but requiring that would cause compatibility problems with old jobs.

On Wed, Aug 15, 2018 at 8:39 AM Maguin, Eugene <[hidden email]> wrote:

I run across something in the crosstabs command that seems unexplainably odd.

Var1 is A5, zeros is f3.

This statement: crosstabs var1 by zeros.

Yields an error (in part):

Text: by Command: crosstabs

Unrecognized text was found where a variable list was expected.

Execution of this command stops.

 

However, from the menu:

CROSSTABS  /TABLES=var1 BY zeros  /FORMAT=AVALUE TABLES  /CELLS=COUNT  /COUNT ROUND CELL.

Run fine. And the edited text runs fine.

CROSSTABS  /TABLES=var1 BY zeros.

 

So, the command processor is not recognizing “var1” as a named variable. It also won’t recognize “var2”, “var10”, “var1a”, but “table” works fine.

 

Gene Maguin

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


--
Jon K Peck
[hidden email]

===================== 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: variable name specification oddity on crosstabs

Maguin, Eugene

Thank you. Now that you point that out, Variables is a keyword used across multiple commands.

 

From: Jon Peck <[hidden email]>
Sent: Wednesday, August 15, 2018 12:49 PM
To: Maguin, Eugene <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] variable name specification oddity on crosstabs

 

If you look at the syntax chart for CROSSTABS, you see this (partial extract)

 

General mode:

CROSSTABS [TABLES=]varlist BY varlist [BY...] [/varlist...]

 

Integer mode :

CROSSTABS VARIABLES=varlist(min,max) [varlist...]

/TABLES=varlist BY varlist [BY...] [/varlist...]

 

Now, in olden times, three-character abbreviation in syntax was allowed, and this is still allowed for commands that existed at the time the rule was changed.  So VAR is recognized as the keyword VARIABLES in INTEGER mode even if you wrote it as var1 or similar.

 

It's sloppy parsing, but it is easy to avoid by using the TABLES keyword.  It was never corrected as modern is always to use /TABLES, but requiring that would cause compatibility problems with old jobs.

 

On Wed, Aug 15, 2018 at 8:39 AM Maguin, Eugene <[hidden email]> wrote:

I run across something in the crosstabs command that seems unexplainably odd.

Var1 is A5, zeros is f3.

This statement: crosstabs var1 by zeros.

Yields an error (in part):

Text: by Command: crosstabs

Unrecognized text was found where a variable list was expected.

Execution of this command stops.

 

However, from the menu:

CROSSTABS  /TABLES=var1 BY zeros  /FORMAT=AVALUE TABLES  /CELLS=COUNT  /COUNT ROUND CELL.

Run fine. And the edited text runs fine.

CROSSTABS  /TABLES=var1 BY zeros.

 

So, the command processor is not recognizing “var1” as a named variable. It also won’t recognize “var2”, “var10”, “var1a”, but “table” works fine.

 

Gene Maguin

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


 

--

Jon K Peck
[hidden email]

===================== 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: variable name specification oddity on crosstabs

Jon Peck
Variables, however, is not a reserved word.  You could have a variable named Variables.  And it would work in CROSSTABS if you used TABLES.

On Wed, Aug 15, 2018 at 11:33 AM Maguin, Eugene <[hidden email]> wrote:

Thank you. Now that you point that out, Variables is a keyword used across multiple commands.

 

From: Jon Peck <[hidden email]>
Sent: Wednesday, August 15, 2018 12:49 PM
To: Maguin, Eugene <[hidden email]>
Cc: SPSS List <[hidden email]>
Subject: Re: [SPSSX-L] variable name specification oddity on crosstabs

 

If you look at the syntax chart for CROSSTABS, you see this (partial extract)

 

General mode:

CROSSTABS [TABLES=]varlist BY varlist [BY...] [/varlist...]

 

Integer mode :

CROSSTABS VARIABLES=varlist(min,max) [varlist...]

/TABLES=varlist BY varlist [BY...] [/varlist...]

 

Now, in olden times, three-character abbreviation in syntax was allowed, and this is still allowed for commands that existed at the time the rule was changed.  So VAR is recognized as the keyword VARIABLES in INTEGER mode even if you wrote it as var1 or similar.

 

It's sloppy parsing, but it is easy to avoid by using the TABLES keyword.  It was never corrected as modern is always to use /TABLES, but requiring that would cause compatibility problems with old jobs.

 

On Wed, Aug 15, 2018 at 8:39 AM Maguin, Eugene <[hidden email]> wrote:

I run across something in the crosstabs command that seems unexplainably odd.

Var1 is A5, zeros is f3.

This statement: crosstabs var1 by zeros.

Yields an error (in part):

Text: by Command: crosstabs

Unrecognized text was found where a variable list was expected.

Execution of this command stops.

 

However, from the menu:

CROSSTABS  /TABLES=var1 BY zeros  /FORMAT=AVALUE TABLES  /CELLS=COUNT  /COUNT ROUND CELL.

Run fine. And the edited text runs fine.

CROSSTABS  /TABLES=var1 BY zeros.

 

So, the command processor is not recognizing “var1” as a named variable. It also won’t recognize “var2”, “var10”, “var1a”, but “table” works fine.

 

Gene Maguin

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


 

--

Jon K Peck
[hidden email]

--
Jon K Peck
[hidden email]

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