Date: Tue, 27 Sep 2005 11:58:21 +0200
Reply-To: Spousta Jan <JSpousta@CSAS.CZ>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: Spousta Jan <JSpousta@CSAS.CZ>
Subject: Re: need help with a macro
Content-Type: text/plain; charset="US-ASCII"
Hi Cady,
As far as I know, you cannot use AGGREGATE in the LOOP - END LOOP
construction. You should consider to replace it by a !DO construction.
Greetings
Jan
-----Original Message-----
From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of
Cady Wan
Sent: Tuesday, September 27, 2005 11:37 AM
To: SPSSX-L@LISTSERV.UGA.EDU
Subject: need help with a macro
Dear list,
I wrote the following macro:
DEFINE !anpassen (alt = !charend('/')/neu = !cmdend) LOOP #i = 100 to 5
by -20.
IF (abs(!alt - !neu) > #i) & ((!neu/!alt-1) > 0.01) & (!neu > !alt)
!neu = max((!alt+#i), rnd(1.01*!alt)).
IF (abs(!alt - !neu) > #i) & ((!neu/!alt-1) > 0.01) & (!neu < !alt)
!neu = min((!alt-#i), rnd(0.99*!alt)).
AGGREGATE
/OUTFILE=*
MODE=ADDVARIABLES
/BREAK=kgs02/neu = SUM(!neu).
END LOOP IF (abs((neu/alt -1)) <= 0.02).
!ENDDEFINE.
I became the following error message:
>Error # 4095. Command name: AGGREGATE
>The transformations program contains an unclosed
LOOP, DO IF, or complex
>file structure. Use the level-of-control shown to
the left of the SPSS
>commands to determine the range of LOOPs and DO IFs.
>This command not executed.
Can someone help me? Thanks in advance!
I am using SPSS 13.
Greetings,
Cady
______________________________________________________
Yahoo! for Good
Donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/