Date: Tue, 3 May 2005 11:31:04 -0400
Reply-To: necia <black@BUFFALO.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: necia <black@BUFFALO.EDU>
Organization: The University at Buffalo
Subject: Re: Syntax Question
In-Reply-To: <HaEde.29641$tg1.26403@edtnps84>
Content-Type: TEXT/PLAIN; charset=US-ASCII
There may be nothing wrong with the syntax, but "transformations" will not
get executed until SPSS encounters a procedure, OR, an execute command if
you have no procedure immediately following the transformations. Execute
would probably only be needed after the end of the END REPEAT, but you can
force execution with multiple execute commands if you like.
The syntax you have shown has NO procedure listed. Have you ever noticed
the message "execution pending" while running a program? It's waiting for
something, like EXECUTE or a procedure, to trigger the running of the
"transformations".
HTH. I really did like the days of syntax!
Cheers,
Necia
Necia A. Black, Ph.D. e-mail: black@buffalo.edu
246 Computing Center Web URL:http://www.acsu.buffalo.edu/~black
SUNY-Buffalo FAX: (716) 645-3734
Buffalo, New York 14260 Phone: (716) 645-3572
On Tue, 3 May 2005, Max wrote:
> Hi all,
>
> What is wrong with following syntax (SPSS 12)? It complains about "exec"
> inside DO REPEAT, but without "exec" values are not calculated for meds:
>
> /*------------------------------start----------------.
> compute meds = 0 .
> exec .
>
> DEFINE calc_meds (arg1 = !TOKENS(1))
> compute dummy = 0.
> exec.
> IF (!arg1 ~= LAG(!arg1)) dummy = dummy+1 .
> exec.
> IF (dates >= DATE.DMY(13, 7, 1999)) dummy = dummy+LAG(dummy) .
> exec.
> compute meds = meds + dummy .
> exec.
> !ENDDEFINE.
>
> DO REPEAT medic = apo_acetaminophen TO spectrum.29 .
> calc_meds arg1 = medic .
> END REPEAT print.
> exec.
> /*----------------------------------end---------------.
>
>
>
>
|