Date: Fri, 27 Oct 2006 09:51:06 -0500
Reply-To: "Beadle, ViAnn" <viann@spss.com>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: "Beadle, ViAnn" <viann@spss.com>
Subject: Re: data list within a simple macro won't work
Content-Type: text/plain; charset="iso-8859-1"
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
AjR> current data set so I can rename it, change the
AjR> attributes, move it, etc. But why does the syntax
AjR> below not work? SPSS keeps giving the message 'waiting
AjR> for more inline data'. Indenting, or putting
AjR> everything on 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)