Hi everyone, I'm not experienced with macros and I have two questions about them. I have a macro that runs Proc PHReg in a certain setting, and I would like to optimize how it works, so: Question 1: Can I add a macro variable as text, which would then run as a WHERE statement in the proc phreg. Example: %MyPHReg (datain, where, time, censor, var);
Proc PHReg data=&datain;
&where.;
model &time. * &censor.(1) = &var.;
run;
%MEnd;
/* and to use the macro*/
%MyPHReg (mydata, Where X = 1, Survival, Censor, Smoking); I have tried this but it didn't work. I know that macro variables should be variables, but can I integrate text? Question 2: I'm running a similar functioning macro for several data sets (here as &datain.) and several influence variables (here as &var.). Can I identify a matrix of data sets and variables and request the macro to run all possible combinations. Example: /* something faster and more practicable instead of running the following */
%MyPHReg (dataset1, Survival, Censor, Age);
%MyPHReg (dataset1, Survival, Censor, Smoking);
%MyPHReg (dataset1, Survival, Censor, Alcohol);
%MyPHReg (dataset2, Survival, Censor, Age);
%MyPHReg (dataset2, Survival, Censor, Smoking);
%MyPHReg (dataset2, Survival, Censor, Alcohol);
%MyPHReg (dataset3, Survival, Censor, Age);
%MyPHReg (dataset3, Survival, Censor, Smoking);
%MyPHReg (dataset3, Survival, Censor, Alcohol);
Thanks Ubai
... View more