%macro multcond(dsname);
%local rc dsid exist nlobs readpw;
%let rc=1;
%let dsid=0;
%let exist=%sysfunc(exist(&dsname));
%if &exist=0 %then %goto setrc;
%let dsid=%sysfunc(open(&dsname,i));
%if &dsid le 0 %then %goto setrc;
%let nlobs=%sysfunc(attrn(&dsid,nlobs));
%if &nlobs le 0 %then %goto setrc;
%let readpw=%sysfunc(attrn(&dsid,readpw));
%if &readpw=1 %then %goto setrc;
%goto exit;
%setrc:
%let rc=0;
%exit:
%if &dsid ne %then %let closerc=%sysfunc(close(&dsid));
%sysfunc(putn(&rc,1))
%mend;
%macro listsample(dsname);
%if %multcond(&dsname)=1 %then %do;
proc print data=&dsname(obs=10);
title "First 10 Observations of &dsname";
run;
%end;
%else %put error:***data set &dsname cannot be listed.;
%mend listsample;
%listsample(books.ytdsales)
%listsample(books.ytdsaless)
这段程序在multcond宏中的%mend前一句 %sysfunc(putn(&rc,1))后面加了分号为什么就得不到想要的结果。为什么不加分号