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

 

BASUG is hosting free webinars Next up: Mike Raithel presenting on validating data files on Wednesday July 17. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
WarrenKuhfeld
Rhodochrosite | Level 12

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
Rhodochrosite | Level 12

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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 6437 views
  • 5 likes
  • 5 in conversation