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
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
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
Thank you very much.
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
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.