*This versions receives the profiling macro name as its first argument; * and gives an iteration counter; %MACRO Plkhci(macroname,lower,upper,max,side,tol=0.000001,alpha=0.05); %LET ProfileIteration=0; %DO %WHILE (%SYSEVALF(&upper-&lower>&tol)); %LET profilepar=%SYSEVALF(0.5*(&lower+&upper)); %LET ProfileIteration=%EVAL(&ProfileIteration+1); %PUT At iteration &ProfileIteration: profile parameter=&profilepar; ODS OUTPUT FitStatistics=FitStatistics; %¯oname(&profilepar); DATA _temp_; SET FitStatistics; IF _N_=1; target=%SYSEVALF(&max)-CINV(1-&alpha,1)/2; LogL=-Value/2; profilepar=%SYSEVALF(&profilepar); IF ((&side="L" AND LogL>target)OR(&side="R" AND LogL