Hi Mahesh,
Is there such a way? Not that I knew. (As if that meant a lot 😉 )
However you could create a macro replacement to the RUN and QUIT statement respectively.
Somewhat like this:
%macro static_macro ( called_after = NONE ) ;
%put &sysmacroname called after &called_after ;
%mend static_macro ;
%macro rq (rq_cmd) ;
%local _sp ;
%let _sp = &sysprocname ;
&rq_cmd ;
%static_macro ( called_after = &_sp ) ;
%mend rq ;
data _null _ ;
put 'Note: Message from datastep.' ;
%rq ( run ) ;
proc sql noprint ;
select max(age) as max_age from sashelp.class ;
%rq ( quit ) ;
So not an EVENT like solution, much rather a workaround.
BTW: you could get fancier by using automatic macro variable &SYSPROCNAME but I think coding RUN/QUIT as an argument of the RQ macro enhances readability.
Kind regards
Robert