BookmarkSubscribeRSS Feed
Annalena
Fluorite | Level 6

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?

6 REPLIES 6
Quentin
Super User

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

 

WarrenKuhfeld
Ammonite | Level 13

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.

novinosrin
Tourmaline | Level 20

Try running again after turning on SPOOL option  

OPTIONS SPOOL;

SASKiwi
PROC Star

I reckon it might be the use of comment strings like /*----*/ in the macro causing issues. Change to the macro comment style: %*------;

WarrenKuhfeld
Ammonite | Level 13

Actually, /* */ comments are fine in a macro. I use them all the time.

Annalena
Fluorite | Level 6

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. Smiley Embarassed Smiley Very Happy

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 6 replies
  • 7550 views
  • 5 likes
  • 5 in conversation