醉_清风 发表于 2010-4-1 17:17 
data _null_;
call symput('mth',put(intnx('month',today(),-1,'end'),yymmn6.));
run;
%put &mth;
如果一定要取年月,可用year和month函数
醉_清风,
The symput is replaced by symputx that takes care of type conversion + trailing space elimination.
Another useful function dealing with date is "intck".
49 data _null_;
50 call symputx('mth',month(intnx('month',today(),-1,'end')));
51 run;
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
52 %put >>>&mth<<<;
>>>3<<<