From: jaheuk on
how can I store the result of the calculating in a macrovar NOT using
a datastep?

%let now_day = "20jun10"d ;
%let prev_year = intnx('year',&now_day,-1,'E');

/***THIS WORKS**/
data a;
v1=&prev_year;
format v1 date9. ;
run;

/***THIS DOES NOT WORK***/
%put >>>>PREVIOUS YEAR : %SYSFUNC(&prev_year,date9.);

here I tried several things but nothing helps


regards,
Herman
From: jaheuk on
ok guys,
i found the solution in a paper!!

%let sday = "28jul10"d ;
%let prev_day = %SYSFUNC(intnx(weekday, &sday , -1 , S ) );

using INTNX in a macro ==> remove quotes from the parameters WEEKDAY
and S

cheers,
Herman








On 4 jul, 10:37, jaheuk <hejac...(a)gmail.com> wrote:
> how can I store the result of the calculating in a macrovar NOT using
> a datastep?
>
> %let now_day = "20jun10"d ;
> %let prev_year = intnx('year',&now_day,-1,'E');
>
> /***THIS WORKS**/
> data a;
>  v1=&prev_year;
>  format v1 date9. ;
> run;
>
> /***THIS DOES NOT WORK***/
> %put >>>>PREVIOUS YEAR : %SYSFUNC(&prev_year,date9.);
>
> here I tried several things but nothing helps
>
> regards,
> Herman