Syntax results in incorrect variable name - not defined

#1
Thanks in advance for your assistance.

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?:confused:

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.
TITLE “'Leadership-6'
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).
 
#3
There's nothing wrong with the syntax (apart from all the unnecessary execute commands). If you're getting an undefined variable error it means that you've got an undefined variable. I suggest going back to your dataset and checking carefully that the variable 'SSL' exists or there's no typo in the syntax or your dataset.