how could I count big macro running time

Accepted Solution Solved
Reply
Contributor
Posts: 60
Accepted Solution

how could I count big macro running time

Hello,

 

I want to compare the running time difference of a large MACRO with several different small macro. 

For example. one is %macro A and another is %micro B. what code I should use and where I should input?


%micro A; %micro bb; %micro ccc; %mend ccc; %mend bb; %mend A; %micro B; %micro bb; %micro ccc; %micro dddd; %mend dddd; %mend ccc; %mend bb; %mend B;

Thanks a lot


Accepted Solutions
Solution
‎03-17-2018 07:01 PM
Super User
Posts: 22,529

Re: how could I count big macro running time

Posted in reply to xiangpang

https://blogs.sas.com/content/sgf/2015/01/21/sas-timer-the-key-to-writing-efficient-sas-code/

 


@xiangpang wrote:

Hello,

 

I want to compare the running time difference of a large MACRO with several different small macro. 

For example. one is %macro A and another is %micro B. what code I should use and where I should input?


%micro A; %micro bb; %micro ccc; %mend ccc; %mend bb; %mend A; %micro B; %micro bb; %micro ccc; %micro dddd; %mend dddd; %mend ccc; %mend bb; %mend B;

Thanks a lot


 

View solution in original post


All Replies
Solution
‎03-17-2018 07:01 PM
Super User
Posts: 22,529

Re: how could I count big macro running time

Posted in reply to xiangpang

https://blogs.sas.com/content/sgf/2015/01/21/sas-timer-the-key-to-writing-efficient-sas-code/

 


@xiangpang wrote:

Hello,

 

I want to compare the running time difference of a large MACRO with several different small macro. 

For example. one is %macro A and another is %micro B. what code I should use and where I should input?


%micro A; %micro bb; %micro ccc; %mend ccc; %mend bb; %mend A; %micro B; %micro bb; %micro ccc; %micro dddd; %mend dddd; %mend ccc; %mend bb; %mend B;

Thanks a lot


 

Contributor
Posts: 60

Re: how could I count big macro running time

Thank you very much.

Super User
Super User
Posts: 7,756

Re: how could I count big macro running time

[ Edited ]
Posted in reply to xiangpang

I think you got an answer to your question but the code you posted is very puzzling. It seems to show marco DEFINITIONS nested inside of each other. 

 

You should NEVER do that.

 

You can call another macro inside of a macro, so that when it runs they are nested.  But the store of compiled macros is a flat directory.  At any point in time you can only have one macro named CCC.  You cannot have one defined inside of A and a different one that is defined only when B is running.   If you compile a new definition of CCC it overwrites the previous definition of CCC.

%macro A;
  %put Inside A;
  %bb;
  %put Back to A;
%mend A;
%macro bb;
  %put Inside BB;
  %ccc;
  %put Back to BB;
%mend bb;
%macro ccc;
  %put Inside CCC ;
%mend ccc;
317  %A;
Inside A
Inside BB
Inside CCC
MPRINT(BB):  ;
Back to BB
MPRINT(A):  ;
Back to A

 

 

Contributor
Posts: 60

Re: how could I count big macro running time

Sorry for the confuse. I run macroA and macroB in different dataset at different time. Thanks for the comment. I am still a beginner and thanks for teaching.
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 131 views
  • 0 likes
  • 3 in conversation