<P>我现在在学习base sas中的宏功能,发现其中的一段程序有点问题,希望能够得到解答,谢谢。</P>
<P>P.S:顺便希望能够推荐一些关于sas宏功能的书。</P>
<P>这段程序在sas8.2上运行 </P>
<P>option symbolgen;<BR>option mprint;<BR> data new;<BR> input age income;<BR> cards;<BR> 10 0<BR> 11 100<BR> 12 200<BR> 13 150<BR> 15 288<BR> 14 148<BR> 18 658<BR> 19 894<BR> 15 525<BR> ;<BR>run;<BR>%macro create;<BR> data new1;<BR> set work.new;<BR> if age<=16;<BR>run;<BR>%mend create;</P>
<P>%macro plot(yvar,xvar);<BR> proc plot data=work.new;<BR> plot &yvar*&xvar;<BR> run;<BR> %mend plot;</P>
<P>%macro analyze(yvar,xvar);<BR> %put do you want to execute the data step<FONT color=#000000>?;<BR> %input getdata</FONT>;<BR> %if %upcase(&getdata)=YES %then %create;<BR> %plot(&yvar,&xvar)<BR>%mend analyze;<BR>%analyze(income,age)</P>


雷达卡



京公网安备 11010802022788号







