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

 

The Boston Area SAS Users Group (BASUG) is hosting our in person SAS Blowout on Oct 18!
This full-day event in Cambridge, Mass features four presenters from SAS, presenting on a range of SAS 9 programming topics. Pre-registration by Oct 15 is required.
Full details and registration info at https://www.basug.org/events.
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

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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