Date: Mon, 2 Feb 2004 12:48:49 -0500
Reply-To: "DePuy, Venita" <depuy001@DCRI.DUKE.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "DePuy, Venita" <depuy001@DCRI.DUKE.EDU>
Subject: %if/%then resolution - shouldn't be true?
Content-Type: text/plain
Hi all -
hopefully a simple question.
I think this %if/%then statement should resolve to false, instead it comes
out as true.
(This is a simplified bit of a larger process).
Code and partial log follows.
Output = both print statements run.
Thanks,
Venita
data test1;
input variable $ probt @@;
cards;
Intercep 0.5 s 0.0026 s_sq 0.0232
;
proc print;
%macro file1;
data test1; set test1; where variable ne 'Intercep';
proc sort data=test1; by probt;
%if last.Probt > .05 OR last.Probt = . %then %do;
proc print;run;
%end;
%mend;
%file1;
<log for data step not included here>
41368 %macro file1;
41369 data test1; set test1; where variable ne 'Intercep';
41370 proc sort data=test1; by probt;
41371 %if last.Probt > .05 OR last.Probt = . %then %do;
41372 proc print;run;
41373 %end;
41374 %mend;
41375 %file1;
MPRINT(FILE1): data test1;
MPRINT(FILE1): set test1;
MPRINT(FILE1): where variable ne 'Intercep';
NOTE: There were 2 observations read from the data set WORK.TEST1.
WHERE variable not = 'Intercep';
NOTE: The data set WORK.TEST1 has 2 observations and 2 variables.
NOTE: DATA statement used:
real time 0.01 seconds
cpu time 0.00 seconds
MPRINT(FILE1): proc sort data=test1;
MPRINT(FILE1): by probt;
MLOGIC(FILE1): %IF condition last.Probt > .05 OR last.Probt = . is TRUE
NOTE: There were 2 observations read from the data set WORK.TEST1.
NOTE: The data set WORK.TEST1 has 2 observations and 2 variables.
NOTE: PROCEDURE SORT used:
real time 0.01 seconds
cpu time 0.01 seconds
MPRINT(FILE1): proc print;
MPRINT(FILE1): run;
NOTE: There were 2 observations read from the data set WORK.TEST1.
NOTE: PROCEDURE PRINT used:
real time 0.01 seconds
cpu time 0.01 seconds