Search code examples
sassas-macro

SAS macro doesn't work, but no errors or warnings


I am constructing ROC curve in SAS University with 100 observations where State is state of nature - positive or negative test, and OD is optical density. Data set is called datain.

data datain;
length State $ 1;
input State $ OD @@;
datalines;
P 0.745 N 0.790 P 1.440 P 0.790 (and so on...);
run;
%let lowlim=0.50;
%let uplim=1.50;
%macro roc(datain, lowlim, uplim, ninc=20);
options mtrace mprint;
data roc;
set &datain;
lowlim=&lowlim; uplim=&uplim; ninc=&ninc;
do i=1 to ninc+1;
cutoff=lowlim+(i-1)*((uplim-lowlim)/ninc);
if OD > cutoff then test="R"; else test="N";
output;
end;
drop i;
run;
proc print;
run;
%mend;

When I run macro and proc print, there are no errors or warning. In LOG says:

OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
ODS HTML CLOSE;
&GRAPHTERM; ;*';*";*/;RUN;QUIT;
QUIT;RUN;
ODS HTML5 (ID=WEB) CLOSE;
ODS RTF (ID=WEB) CLOSE;
ODS PDF (ID=WEB) CLOSE;
FILENAME _GSFNAME;
DATA _NULL_;
RUN;
OPTIONS VALIDMEMNAME=COMPAT;
OPTIONS NOTES STIMER SOURCE SYNTAXCHECK;

Any idea why this isn't working?


Solution

  • Have you tried actually calling your macro?

    %roc(datain,&lowlim,&uplim,ninc=20);