The following SAS program is submitted:
options yearcutoff = 1950;
%macro y2kopt(date);
%if &date >= 14610 %then %do;
options yearcutoff = 2000;
%end;
%else %do;
options yearcutoff = 1900;
%end;
%mend;
data _null_;
date = "01jan2000"d;
call symput("date",left(date));
run;
%y2kopt(&date)
The SAS date for January 1, 2000 is 14610 and the SAS system option for YEARCUTOFF is set to 1920 prior to submitting
the above program. Which one of the following is the value of YEARCUTOFF when the macro finishes execution?
答案是2000. 试了程序确实是对的。但是我有点困惑就是Macro不是都作为char var。除非用input 转换,不然怎么可以用来比大小呢?非常感谢! 祝大家新年快乐!