Date: Fri, 9 Sep 2005 22:07:06 -0400
Reply-To: Richard Ristow <firstname.lastname@example.org>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Richard Ristow <email@example.com>
Subject: Re: problem with insert inserting a macro-command
In-Reply-To: <83536658864BC243BE3C06D7E936ABD502D51A33@xchg1.statistik.l ocal>
Content-Type: text/plain; charset="iso-8859-1"; format=flowed
Did anyone ever resolve this? If not, ...
At 07:59 AM 9/1/2005, MOSER Winfried wrote:
>within a macro i use a insert-command to insert the command-line
>("p11" is not constant, therefore i have to use insert).
>the program does not accept the line and says:
>The first word in the line is not recognized as an SPSS command. This
>command not executed.
>does anyone know, why spss doesn't accept !let as an spss-command, if
You've put an INSERT into the middle of a macro definition, hoping the
INSERTed code would become part of the macro definition. But it won't.
Instead, the INSERT, itself, becomes part of the macro definition. The
macro is expanded; the INSERT is there, and is executed; the !let
statement is encountered; and, since a macro definition is not in
progress at that point, it's an error. (Remember, this is the
*expanded* macro code.)
The usual solution is,
A. In the inserted file, instead of
DEFINE !pmax() p11 !ENDDEFINE.
B. Take the INSERT statement out of your macro definition. Instead, put
it in your code (your 'syntax') just before the macro is invoked (is
'run'). In the macro, use the value !pmax just as you already do.
I may have some glitches here, but that's basically how to do it.
>thanks for any hint.
>1703 * End of INSERT and INCLUDE nesting level 01.
>1703 M> * End of INSERT and INCLUDE nesting level 01.
>1704 M> insert file='d:\temp\r5_pmax.sps'.
>1704 !let !pmax=p11.
>1704 M> !let !pmax=p11.
> >Error # 1. Command name: !let
> >The first word in the line is not recognized as an SPSS command.
> >This command not executed.
>Mag. Winfried Moser
>Analyse und Prognose
>T: +43 (01)71128 7039
>F: +43(01)71128 7455