Date: Mon, 1 Dec 2003 23:50:26 +0100 Reply-To: lucameyer@tiscali.it Sender: "SPSSX(r) Discussion" From: Luca Meyer Organization: Luca Meyer Subject: R: What's wrong with my macro/syntax? Comments: To: 'joão duarte' In-Reply-To: <009a01c3b832\$eb45c680\$0100fea9@pt> Content-Type: text/plain; charset="iso-8859-1" Thank you João, indeed that appears to be the matter! Luca > -----Messaggio originale----- > Da: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] Per > conto di joão duarte > Inviato: lunedì 1 dicembre 2003 18.46 > A: SPSSX-L@LISTSERV.UGA.EDU > Oggetto: Re: What's wrong with my macro/syntax? > > > the second line of define command seems to begin at first column. > > > João Duarte > _______________________ > ProADE Market Research > Tel. 217963889 - 963031666 > jd@proade.com www.proade.com > > > > > ----- Original Message ----- > From: "Smith, Anne" > Newsgroups: bit.listserv.spssx-l > To: > Sent: Segunda-feira, 1 de Dezembro de 2003 17:33 > Subject: Re: What's wrong with my macro/syntax? > > > > I'm not sure if this is the issue, but there is no command > terminator > > ( > . ) > > after your DEFINE statement. > > > > Anne Smith > > > > > > -----Original Message----- > > From: Luca Meyer [mailto:lucameyer@tiscali.it] > > Sent: 01 December 2003 17:30 > > To: SPSSX-L@LISTSERV.UGA.EDU > > Subject: What's wrong with my macro/syntax? > > > > > > 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/ >

Back to: Top of message | Previous page | Main SPSSX-L page