# Syntax results in incorrect variable name - not defined

#### srdavisgb

##### New Member

I have been using the following syntax to calculate Chi Square stats (for a large number of groups). Somewhere I have corrupted the code and cannot get it to run due to a variable not defined error (included below). A second error message regarding the filter is also displayed. The variable is defined in the dataset and works with the other SPSS programs. I'm thinking it must be something in the syntax that has been changed inadvertently or omitted.

Any suggestions?

USE ALL.
COMPUTE filter_$=(SSL ='Leadership-6'). TITLE “'Leadership-6' VARIABLE LABEL filter_$ "SSL ='Leadership-6' (FILTER)".
VALUE LABELS filter_$0 'Not Selected' 1 'Selected'. FORMAT filter_$ (f1.0).
FILTER BY filter_$. EXECUTE . IF (HrlyRt > 30.29) MEDIANT = 1 . EXECUTE . IF (HrlyRt < 30.29) MEDIANT = 2 . EXECUTE . CROSSTABS /TABLES=mediant BY Gender/FORMAT= AVALUE TABLES /STATISTIC=CHISQ /CELLS= COUNT. First error message: COMPUTE filter_$=(SSL ='Leadership-6').

>Error # 4285 in column 19. Text: SSL
>Incorrect variable name: either the name is more than 64 characters, or it is
>not defined by a previous command.
>Execution of this command stops.
VARIABLE LABEL filter_$"SSL ='Leadership-6' (FILTER)". VALUE LABELS filter_$ 0 'Not Selected' 1 'Selected'.

Second error message:
>Warning # 4474. Command name: VALUE LABELS
>The (ADD) VALUE LABELS command specifies an unknown variable name. The name
>will be ignored.
>The error is associated with 'filter_$' FORMAT filter_$ (f1.0).