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 |
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:
|
Thank you. Now that you point that out, Variables is a keyword used across multiple commands.
From: Jon Peck <[hidden email]>
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:
-- Jon K 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:
-- |
Free forum by Nabble | Edit this page |