Hello,
I coded a macro which I then invoked in a second macro like this:
%macro evtstudy(industry,start,end,number);
/*....*/
%mend evtstudy;
/*Evoke event study macro for different industries and event windows*/
%macro evtrun (industry);
%evtstudy (&industry.,-2,3,1);
%mend evtrun;
%evtrun(aerodef);
run;Before I changed it into a macro everything worked fine but now I always get the error
485: ROW and COLUMN could not be determined.
NOTE: NOSPOOL is on. Rerunning with OPTION SPOOL might allow recovery of the LINE and COLUMN where the error has occurred.I wonder if it is because how I invoked the macro inside the other macro?
Invoking a macro within another macro is fine, and often a good idea. That sort of message is hard to debug, but the problem should be somewhere within your code (could be missing semicolon sometimes?).
Below example code runs fine:
%macro evtstudy(industry,start,end,number);
%put macro EVTSTUDY running &=industry &=start &=end &=number ;
%mend evtstudy;
%macro evtrun (industry);
%put macro EVTRUN running &=industry ;
%evtstudy (&industry.,-2,3,1);
%mend evtrun;
%evtrun(aerodef)
Logs is:
34 %evtrun(aerodef) macro EVTRUN running INDUSTRY=aerodef macro EVTSTUDY running INDUSTRY=aerodef START=-2 END=3 NUMBER=1
Calling a macro from another macro is not a problem. I do it all the time. You must be doing something else wrong.
OPTIONS MPRINT;
and lots of other debugging options can help you debug.
Try running again after turning on SPOOL option
OPTIONS SPOOL;
I reckon it might be the use of comment strings like /*----*/ in the macro causing issues. Change to the macro comment style: %*------;
Actually, /* */ comments are fine in a macro. I use them all the time.
Hey everybody, thank you for your answers!
It was actually a way simpler problem. Im invoking this macro for about 100 data sets, but had forgotten one of them in the import macro.. obviously SAS can't compute anything then.. I didn't see this before because SAS Studio didn't show the whole log.
Sorry, Im still a beginner.
![]()
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.