|
<table cellspacing='0' cellpadding='0' border='0' ><tr><td style='font: inherit;'>Dear All,<br><br>I am encountering a strange problem when I did a macro with PROC IML
code embedded inside. The idea is actually a very
simple one:
<br>
<br>%macro EM(inpar=,indata=,maxiter=,toler=);.....%mend.
<br>
<br>I only need to pass 4 macro variables into PROC IML. part of IML code using the macro variables.<br><br>Start estimation(probx1,prob,mu0,mu1,std0,std1) global(y,x,esrd,trt);<br><br> ***more code***;<br><br> do until(L[step]-L[step-1]<&toler | step >=&maxiter);<br><br> step=step+1;<br><br> /* E-step */<br> prob_subj=Estep(probx1_cur,probx0_cur,mu0_cur,mu1_cur,std0_cur,std1_cur,<br> xeffect_cur);<br><br> /* M-step */<br><br>
update=Mstep(prob_subj,probx1_cur,probx0_cur,mu0_cur,mu1_cur,std0_cur,std1_cur,xeffect_cur); <br><br> ***paramters used in e-step will be updated;<br><br> mu1_cur =update[1:4];<br> mu0_cur =update[5:8];<br> std1_cur =update[9:12];<br> std0_cur =update[13:16];<br> probx1_cur =update[17:20];<br> probx0_cur
=update[21:24];<br> xeffect_cur=update[25];<br><br> end;<br><br> ***more code***<br><br> finish;<br><br><br> However, whenever I
ran the code, it would not give any sign of being executed (I checked
log file- no blue colored comments).Then I tried to run other unrelated codes to see if SAS was dead and nothing happened . I had to quit SAS. This problem happened
every time.
<br>
<br>The strange thing was that after I use 4 %let statement to pass macro
variables to PROC IML, the code would run without problem. I am not sure
why a combination of %MACRO and PROC/IML will have such problem. I did
see a lot of similar codes and the one I created above is nothing
special though.
<br>
<br>Any suggestion will be really appreciated!<br><br>Many thanks,<br><br>Vincent<br>
</td></tr></table><br>
|