Date: Thu, 20 Nov 2008 14:54:58 -0500
Reply-To: joey m <sasuser.joey.m@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: joey m <sasuser.joey.m@GMAIL.COM>
Subject: Re: (optionally) ending a process after sql
In-Reply-To: <014901c94b47$b8c66220$832fa8c0@HP82083701405>
Content-Type: text/plain; charset=ISO-8859-1
Thanks Mary, I think I am getting the idea...I will try your
suggestion, thanks a lot...
On Thu, Nov 20, 2008 at 2:39 PM, Mary <mlhoward@avalon.net> wrote:
> You can put the code into a macro wrapper and then the %IF statement will
> work; since you want to stop if it is > .05,
> then flip the condition and put the code that you want to do inside the IF
> with a condition of <= .05:
>
> %macro do_means;
>
> proc sql noprint;
>
> select cValue1 into:KW_pvalue
>
> from kw_test where name1="XP_KW";
>
> /* if exact p-value is >0.05, I want to stop the program,
>
> if not, do proc means (or any other code thereafter) */
>
> %if &KW_pvalue <= .05 %then %do;
>
> proc means data=react;
>
> run;
> %end;
>
> %mend do_means;
>
> &do_means;
>
>
> -Mary
> ----- Original Message ----- From: joey m
> To: SAS-L@LISTSERV.UGA.EDU
> Sent: Thursday, November 20, 2008 9:33 AM
> Subject: (optionally) ending a process after sql
>
>
>
> Hi there:
>
> I have the following code, and I would like to end the program in case
> the p-value is >0.05; but if it isn't (i.e. p<=0.05), thereafter I would
> like to run any other code.
>
> Many shall find it easy, but it is still a difficult one to me. Any
> suggestion is welcome.
>
> Thanks in advance.
>
>
> *
>
> data* react;
>
> input Stim Time @@;
>
> datalines;
>
> 1 1.94 1 1.94 1 2.92 1 2.92 1 2.92 1 2.92 1 3.27
>
> 1 3.27 1 3.27 1 3.27 1 3.70 1 3.70 1 3.74
>
> 2 3.27 2 3.27 2 3.27 2 3.70 2 3.70 2 3.74
>
> 3 2.25 3 3.21 3 1.35 3 3.7 3 2.5 3 3.5
>
> ;
> *
>
> proc* *npar1way* wilcoxon data=React;
>
> class Stim;
>
> var Time;
>
> exact wilcoxon;
>
> ods output kruskalwallistest=kw_test;
>
> *run*;
> *
>
> proc* *sql*;
>
> select cValue1 into:KW_pvalue
>
> from kw_test where name1="XP_KW";
>
> /* if exact p-value is >0.05, I want to stop the program,
>
> if not, do proc means (or any other code thereafter) */
> *
>
> proc* *means* data=react;
> *
>
> run*;
>
|