I am to systematically summ-up info., invoking macros inside dataset.
The code is fine; the macros are clearly invoked [see LOG, macro variable values are show].
BUT the proc sql and simple put line are not exe'd. The SQL, not taking pass-throu variables, is fine and the result dataset can be created.
The sql need take quite seconds to finish. BUT here is totally ignored and takes no time to exit the macro.
CODE and LOG are below.
/*put all the code, including the ones with condi. here*/
%macro tocall(date, xst, xend, mm_ind);
/*create the dataset*/
proc sql;
create table &indexout._&dt._p2x as
select a.*,
b.ind,
c.lp_prev_grp as lp_prev_grp/*,
d.wt_grp,
d.hibetaflag*/
from &indexout._&dt._pout_wt as b
left join &indexout._&dt._p as a
on a._time_=b._time_
left join &indexout._&dt._lp_prev as c
on a.tick=c.tick
/*left join &indexout. as d
on a.tick=d.tick*/
order by a.tick, a._time_;
quit;
data _temp_lp_st(keep=tick _time_ lp ind rename=(lp=lp_st.)); set &indexout._&dt._p2x; if ind=&xst.; run;quit;
data _temp_lp_end(keep=tick _time_ lp ind rename=(lp=lp_end)); set &indexout._&dt._p2x; if ind=&xend.; run;quit;
%summ_show(&date., &xst., &xend., &mm_ind., , , );
%mend;
%macro summ_show(date, xst, xend, mm_ind, wtcalc1, wtcalc2, condi);
put "here inside summ_show(...)";
%mend;
data _null_;
set &indexout._&dt._mm_ind;
if missing(lp_st_ind)=0 and missing(lp_end_ind)=0 and _N_=3 then do;
result=resolve(cats('%tocall(',catx(',',date,lp_st_ind, lp_end_ind, mm_ind),')'));
end;
run;quit;
3628 %macro tocall(date, xst, xend, mm_ind);
3629 /*create the dataset*/
3630 proc sql;
3631 create table &indexout._&dt._p2x as
3632 select a.*,
3633 b.ind,
3634 c.lp_prev_grp as lp_prev_grp/*,
3635 d.wt_grp,
3636 d.hibetaflag*/
3637 from &indexout._&dt._pout_wt as b
3638 left join &indexout._&dt._p as a
3639 on a._time_=b._time_
3640 left join &indexout._&dt._lp_prev as c
3641 on a.tick=c.tick
3642 /*left join &indexout. as d
3643 on a.tick=d.tick*/
3644 order by a.tick, a._time_;
3645 quit;
3646
3647 data _temp_lp_st(keep=tick _time_ lp ind rename=(lp=lp_st)); set
3647! &indexout._&dt._p2x; if ind=&xst.; run;quit;
3648 data _temp_lp_end(keep=tick _time_ lp ind rename=(lp=lp_end)); set
3648! &indexout._&dt._p2x; if ind=&xend.; run;quit;
3649
3650 %summ_show(&date., &xst., &xend., &mm_ind., , , );
3651
3652 %mend;
3653
3654 %macro summ_show(date, xst, xend, mm_ind, wtcalc1, wtcalc2, condi);
3655 put "here inside summ_show(...)";
3656 %mend;
3657 data _null_;
3658 set &indexout._&dt._mm_ind;
3659 if missing(lp_st_ind)=0 and missing(lp_end_ind)=0 and _N_=3 then do;
3660 result=resolve(cats('%tocall(',catx(',',date,lp_st_ind, lp_end_ind,
3660! mm_ind),')'));
3661 end;
3662 run;
3662! quit;
MLOGIC(TOCALL): Beginning execution.
MLOGIC(TOCALL): Parameter DATE has value 0827
MLOGIC(TOCALL): Parameter XST has value 747
MLOGIC(TOCALL): Parameter XEND has value 1647
MLOGIC(TOCALL): Parameter MM_IND has value 3369
NOTE: DATA statement used (Total process time):
real time 0.04 seconds
cpu time 0.04 seconds
MLOGIC(SUMM_SHOW): Beginning execution.
MLOGIC(SUMM_SHOW): Parameter DATE has value 0827
MLOGIC(SUMM_SHOW): Parameter XST has value 747
MLOGIC(SUMM_SHOW): Parameter XEND has value 1647
MLOGIC(SUMM_SHOW): Parameter MM_IND has value 3369
MLOGIC(SUMM_SHOW): Parameter WTCALC1 has value
MLOGIC(SUMM_SHOW): Parameter WTCALC2 has value
MLOGIC(SUMM_SHOW): Parameter CONDI has value
MLOGIC(SUMM_SHOW): Ending execution.
MLOGIC(TOCALL): Ending execution.
NOTE: There were 9 observations read from the data set WORK.ZZ500_0827_MM_IND.
... View more