LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (May 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 19 May 2008 07:44:57 -0700
Reply-To:   duo_wan@yahoo.com
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   duo wan <duo_wan@YAHOO.COM>
Subject:   A strange error with %MAcro
Content-Type:   text/html; charset=us-ascii

<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>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ***more code***;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; do until(L[step]-L[step-1]&lt;&amp;toler | step &gt;=&amp;maxiter);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; step=step+1;<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /*&nbsp; E-step&nbsp; */<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; prob_subj=Estep(probx1_cur,probx0_cur,mu0_cur,mu1_cur,std0_cur,std1_cur,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xeffect_cur);<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; /*&nbsp; M-step&nbsp; */<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; update=Mstep(prob_subj,probx1_cur,probx0_cur,mu0_cur,mu1_cur,std0_cur,std1_cur,xeffect_cur); <br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ***paramters used in e-step will be updated;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mu1_cur&nbsp;&nbsp;&nbsp; =update[1:4];<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; mu0_cur&nbsp;&nbsp;&nbsp; =update[5:8];<br>&nbsp;&nbsp;&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; std1_cur&nbsp;&nbsp; =update[9:12];<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; std0_cur&nbsp;&nbsp; =update[13:16];<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; probx1_cur =update[17:20];<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; probx0_cur =update[21:24];<br>&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; xeffect_cur=update[25];<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; end;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ***more code***<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; finish;<br><br><br>&nbsp;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>


Back to: Top of message | Previous page | Main SAS-L page