|
I have the following macro (thanks to Raynald for provinding it to me -
see below) in a separate syntax (syntax2.sps) which I call from my main
syntax (sintax1.sps) with an INCLUDE command of the sort:
INCLUDE "c:\temp\syntax2.sps".
Followed by a
!ricod1 var1='temp' var2='1' var3=v1 var4=v2.
*////////////////.
DEFINE !ricod1 (var1=!TOKENS(1) /var2=!TOKENS(1) /var3=!TOKENS(1)
/var4=!TOKENS(1))
SAVE OUTFILE="C:\TEMP\FILE1.sav"
/COMPRESSED.
GET DATA /TYPE = TXT
/FILE =
!QUOTE(!CONCAT('C:\',!UNQUOTE(!var1),'\',!UNQUOTE(!var2),'.csv'))
/DELCASE = LINE
/DELIMITERS = ";"
/ARRANGEMENT = DELIMITED
/FIRSTCASE = 3
/IMPORTCASE = ALL
/VARIABLES =
RISPOSTA A255
CODIFICA A255 .
CACHE.
EXECUTE.
IF CODIFICA ="" CODIFICA=RISPOSTA.
EXE.
WRITE OUTFILE="C:\TEMP\TEMP.SPS"
/'DO IF '!QUOTE(!var3)'="'RISPOSTA'".'
/'COMPUTE '!QUOTE(!var4)'="'CODIFICA'".'
/'END IF.'.
EXE.
GET FILE="C:\TEMP\FILE1.sav".
STRING !var4 (A255).
INCLUDE "C:\TEMP\TEMP.SPS".
EXE.
!ENDDEFINE.
*////////////////.
Now, if I open syntax2.sps and run it manually everything is all right.
But when I call syntax2.sps from syntax1.sps as described above I get
the following error:
>Error # 6819 on line 1031 in column 256. Text: (End of Command)
>The DEFINE command includes an invalid keyword specification. The
>recognized specifications are !DEFAULT, !NOEXPAND, !TOKENS, !CMDEND,
>!CHAREND, and !ENCLOSE.
>This command not executed.
>Error # 6811 on line 1031 in column 256. Text: (End of Command)
>The name of one of the parameters on the DEFINE command is not a valid
>name. The name must begin with an alphabetic and contain a total of 1
to 7
>alphanumeric characters. The exclamation point is not part of the name
as
>defined in the macro header, although it must appear as part of the
name in
>the macro body.
>Error # 6823 on line 1032. Command name: DEFINE
>On the DEFINE command, each parameter definition must include one of
the
>following four specifications: !TOKENS, !CMDEND, !CHAREND, and
!ENCLOSE.
Can anyone help me to find out what I am doing wrong?
Thanks,
Luca
Mr. Luca Meyer
consumer research advisor
http://www.lucameyer.com/en/
|