|
Try a more liberal sprinkling of periods!
define qwerty ().
data list / empty 1-5 (a).
begin data.
empty
end data.
!enddefine.
qwerty.
end data.
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Beadle, ViAnn
Sent: Friday, October 27, 2006 9:51 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: data list within a simple macro won't work
How about a simple NEW FILE command in place of the macro?
________________________________
From: SPSSX(r) Discussion on behalf of Marta García-Granero
Sent: Fri 10/27/2006 9:33 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: Re: data list within a simple macro won't work
Hi Albert-Jan
(You shouldn't complain, my parents christened me using 4 names, fortunately, only one shows in my documents and ID card)
Now, seriously:
AjR> Sometimes I create a mini data set just to unload the current data
AjR> set so I can rename it, change the attributes, move it, etc. But
AjR> why does the syntax below not work? SPSS keeps giving the message
AjR> 'waiting for more inline data'. Indenting, or putting everything on
AjR> one line does not help. Any ideas?
AjR> Albert-Jan
AjR> (that guy so nice they named him twice ;-))
After a bit of T&E (Trial and Error, the best method to learn SPSS syntax sometimes - wry smile), I've found out this:
The BEGIN DATA... END DATA part should be outside the macro, I'm afraid. I couldn't find any reference of that in the syntax guide (but that doesn't necessarily mean it isn't there, I've failed to notice some items in the past).
This works OK, but is of little use:
DEFINE !qwerty().
INPUT PROGRAM.
DATA LIST FIXED/NoData 1-5 (A).
END INPUT PROGRAM.
EXECUTE.
!ENDDEFINE.
!qwerty.
BEGIN DATA
empty
END DATA.
I have tried to put the BEGIN DATA... END DATA inside a second macro to call them consecutevely, but it doesn't work either.
The only thing I can concoct in my brain is to use WRITE OUTFILE to save to disk a file with the necessary commands, and then INCLUDE OR INSERT it.
Don't blame the messenger...
--
Regards,
Dr. Marta García-Granero,PhD mailto:biostatistics@terra.es
Statistician
---
"It is unwise to use a statistical procedure whose use one does not understand. SPSS syntax guide cannot supply this knowledge, and it is certainly no substitute for the basic understanding of statistics and statistical thinking that is essential for the wise choice of methods and the correct interpretation of their results".
(Adapted from WinPepi manual - I'm sure Joe Abrahmson will not mind)
|