starry_night
最近在看一本“SAS Macro Programming Made Easy"的书,有些地方不明白,想请教高手。另外如果碰巧哪位也在看这本书,希望有机会交流。
程序如下:
%macro pbuffparms / parmbuff;
goptions reset=all;
pattern1 c=graybb;
pattern2 c=graydd;
pattern3 c=white;
pattern4 c=grayaa;
goptions ftext=swiss rotate=landscape;
%*----Process this section when parameter values specified;
%if &syspbuff ne %then %do; /*(&syspbuff ne看不懂)*/
%let i=1;
%let month=%scan(&syspbuff,&i);
%do %while(&month ne);
proc gchart data=books.ytdsales(where=(month(datesold)=&month));
title "Sales Report for Month &month";
hbar section / sumvar=saleprice type=sum;
run;
quit;
%let i=%eval(&i+1);
%let month=%scan(&syspbuff,&i);
%end;
%end;
%*----Process this section when no parameter values specified;
%else %do;
proc gchart data=books.ytdsales;
title "Annual Sales by Quarter";
hbar section / sumvar=saleprice type=sum subgroup=datesold
coutline=black;
format datesold qtr.;
run;
quit;
%end;
%mend pbuffparms;
*----Analyze sales for August and November;
%pbuffparms(8,11)
*----Analyze sales for entire year;
%pbuffparms()
我的问题是,%if &syspbuff ne %then %do;这句的&syspbuff变量和谁比较(8 and 11?当提交%pbuffparms后?)
谢谢
starry_night
现在看懂了。
%if &syspbuff ne %then %do;这句子的变量&syspbuff是和赋值参数进行比较,即
*----Analyze sales for August and November;
%pbuffparms(8,11)
*----Analyze sales for entire year;
%pbuffparms()
当%pbuffparms(8,11), %IF condition &syspbuff ne is TRUE
当%pbuffparms(),%IF condition &syspbuff ne is FALSE
另外,我在网上找到 SAS Macro Programming Made Easy电子版,怎么上传给版主呀?
pengfeipower
楼主能不能传给我一份,小弟在这里多谢了
pfjob09@163.com