%put &sysver;
%put &systime;
%put &sysdate;
%put &sysscp;/*返回用户主机系统的缩写*/
title "This macro is writen by &yvar";
%let xvar=123.45;
%let yvar=zhao;
%put xvar;
%put &xvar;
data;
input a;
cards;
1
;
run;
proc print;
run;
%macro create;
data tem;
set peixun.fitness;
if age>=50;
%mend create;
%create;
run;
proc print data=tem;
run;
data temp1;
set peixun.fitness;
run;
%macro plot(yvar=age,xvar=weight);
proc plot;
plot &yvar*&xvar='*';
run;
%mend plot;
%plot()
%plot(xvar=runtime);
quit;
%macro create;
data temp;
set peixun.fitness;
if age>=50;
%mend create;
%*The first macro generates DATA;
%macro plot;
proc plot;
plot &yvar*&xvar='.';
run;
%mend plot;
%*The second macro generates PROC;
%macro analyze(getdata,yvar,xvar);
title;
%if %upcase(&getdata)=YES %then
%do;
%create
title3"Data Set Created for The Plot";
%end;
%plot
%mend analyze;
%analyze(yes,age,weight);
quit;