Help! A SAS/Macro question. Thanks!# Database - 数据库
p*h
1 楼
Please simplify the following program by macro statement. Thanks.
%let gennum12=378;
%let gendte12="06jul2001"d;
*******
*******;
data _null_;
x=mdy(month(&gendte12-28),01,year(&gendte12-28));
y=x+
mod(((6-weekday(x))>=0)*(6-weekday(x))+((6-weekday(x))<0)*(7+6-weekday(x)),7);
call symput('gennum11',put(&gennum12-(&gendte12-y)/7,z3.));
call symput('gendte11','"'!!put(y,date9.)!!'"d');
run;
da
%let gennum12=378;
%let gendte12="06jul2001"d;
*******
*******;
data _null_;
x=mdy(month(&gendte12-28),01,year(&gendte12-28));
y=x+
mod(((6-weekday(x))>=0)*(6-weekday(x))+((6-weekday(x))<0)*(7+6-weekday(x)),7);
call symput('gennum11',put(&gennum12-(&gendte12-y)/7,z3.));
call symput('gendte11','"'!!put(y,date9.)!!'"d');
run;
da