Hi, My macro is not resolving because there is no data for that variable. I tried using data _null_ and set it as "0" values when data does not exist, but no luck. How do I set it to "0" in this situation? proc sql; select count(*) into :obs from g3pop; quit; %put obs: &obs.; %if &obs > 0 %then %do;
proc sql noprint;
*Number/percent of subjects experiencing the events - Toxicity>=3 event;
select (strip(put(count (distinct usubjid), best.))) into :ng3a1 from g3pop where (trtn=1);
select (strip(put(&ng3a1./&trt1.*100, 2.))) into :pg3a1 from g3pop where (trtn=1);
select strip(put(&ng3a1., 5.))||' ('||strip(put(&pg3a1., 2.))||'%)' into :a2 from g3pop where (trtn=1);
select (strip(put(count (distinct usubjid), best.))) into :ng3p2 from g3pop where (trtn=2);
select (strip(put(&ng3p2./&trt2.*100, 2.))) into :pg3p2 from g3pop where (trtn=2);
select strip(put(&ng3p2., 5.))||' ('||strip(put(&pg3p2., 2.))||'%)' into :p2 from g3pop where (trtn=2);
quit;
%end;
%else %do;
data _null_;
call symput('p2','0 (0%)');
call symput('t2','0 (0%)');
call symput('a2','0 (0%)');
run;
%end;
... View more