Re: Strange behavior of VARIABLE LABELS in macro

Posted by Rich Ulrich on
URL: http://spssx-discussion.165.s1.nabble.com/Revision-control-for-SPSS-source-code-tp4267835p4268194.html

> Date: Mon, 28 Mar 2011 12:06:06 -0500
> From: [hidden email]
> Subject: Strange behavior of VARIABLE LABELS in macro
> To: [hidden email]
>
[snip]

>
> If I run the VARIABLE LABELS outside the macro, I don't get the error,
> and every variable gets its correct label.
>
> I can run the VARIABLE LABELS like this:
>
> VARIABLE LABELS
> cod_eva 'V001'
> correlativo 'V002'
> prioridad 'V003'
> codgeo 'V004'.
>
> inside the macro and works fine. I'm triying to understand why
> something like:
>
> VARIABLE LABELS
> cod_eva V001
> correlativo V002
> prioridad V003
> codgeo V004.
>
> doesn't works inside the macro,

The labels are in quotes in the first example, so SPSS knows where
a label ends.  If there was a separate "Variable Labels" line for
each variable, and the label was followed by a period, you could even
have labels with multiple words without quotes.

Since the parser wraps lines together, it does not know that V002  is
supposed to be the whole label for cod_eva.

--
Rich Ulrich




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