Hello
Let's say that I run macro code.
By looking at log window (When SAS didn't finish run)-
How can I know which process SAS is currently running?
(V_months=2111+2110+2109+2108+2107+2106)
or
(V_months=2110+2109+2108+2107+2106+2105)
Should I add any code in order to look at Log window and understand better?
%macro RRR;
code
...
code
%mend RRR;
%RRR(V_months=2111+2110+2109+2108+2107+2106)
%RRR(V_months=2110+2109+2108+2107+2106+2105)
%macro RRR(V_months=);
%put WARNING: %nrstr(%%)&sysmacroname.( &=V_months. ) is running;
data _null_;
set sashelp.class;
run;
%mend RRR;
%RRR(V_months=2111+2110+2109+2108+2107+2106)
%RRR(V_months=2110+2109+2108+2107+2106+2105)
Just for fun:
%macro RRR(V_months=)/parmbuff;
%put WARNING- %nrstr(%%)&sysmacroname.&syspbuff. is running;
data _null_;
set sashelp.class;
run;
%mend RRR;
%RRR(V_months=2111+2110+2109+2108+2107+2106)
%RRR(V_months=2110+2109+2108+2107+2106+2105)
Hi,
This is a bit vague. Can you add a bit more sample code to your example? Do you want to know if the macro is running, or if a DATA step is running, or which iteration of a data step is running, or...
Also, what IDE are you using to submit SAS code (DisplayManager/PC SAS, Enterprise Guide, Studio?).
Typically the starting point might be %PUT or PUT statements. But you might also consider more exotics stuff like using %WINDOW to pop up a message in Display manager, or using SYSECHO in EG, as in these blog posts from Chris Hemedinger:
https://blogs.sas.com/content/sasdummy/2009/05/26/tracking-progress-in-sas-programs-in-sas-enterpris...
https://blogs.sas.com/content/sasdummy/2013/01/30/tracking-progress-with-dosubl/
"2-which iteration of a data step is running," - where is data step in your example ?
You can tell because those two statements (the macro calls) should be in the SAS log.
Trivial example:
1 %macro RRR(V_months); 2 /* code */ 3 %mend RRR; 4 %RRR(V_months=2111+2110+2109+2108+2107+2106) 5 %RRR(V_months=2110+2109+2108+2107+2106+2105)
Or did you issue those macro calls as part of some other macro?
If you turn on MLOGIC you should see the values passed when the macro starts. (although it will make you log much longer if you have complex macro logic).
1 %macro RRR(V_months); 2 /* code */ 3 %mend RRR; 4 options mlogic; 5 %RRR(V_months=2111+2110+2109+2108+2107+2106) MLOGIC(RRR): Beginning execution. MLOGIC(RRR): Parameter V_MONTHS has value 2111+2110+2109+2108+2107+2106 MLOGIC(RRR): Ending execution. 6 %RRR(V_months=2110+2109+2108+2107+2106+2105) MLOGIC(RRR): Beginning execution. MLOGIC(RRR): Parameter V_MONTHS has value 2110+2109+2108+2107+2106+2105 MLOGIC(RRR): Ending execution.
Just for fun, how about to have a cake and to eat a cake:
%macro RRR(V_months=);
options nomlogic;
/* code */
%do i =1 %to 100;
%end;
/* code */
options mlogic;
%mend RRR;
options mlogic;
%RRR(V_months=2111+2110+2109+2108+2107+2106)
%RRR(V_months=2110+2109+2108+2107+2106+2105)
options nomlogic;
Bart
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.