BookmarkSubscribeRSS Feed
abrice520
Obsidian | Level 7

I received the error message "ERROR: Expected open parenthesis after macro function name not found" very randomly. I have no macro functions in my code, at all. I checked and I had a couple "%" in some of my comments that I was keeping notes in, but since they were commented out SAS shouldn't have touched that. 

 

I was importing another file and then ran my whole program and got this message. Now none of my code is running, even simple LIBNAME statements. I tried closing the program and reopening it and that didn't work. What is happening??

 

Here is the import code I ran if that is relevant at all: 

PROC IMPORT
	DATAFILE= "      .csv"
	OUT= Capimpt.Workingdata 
	REPLACE
	DBMS= CSV;
	GUESSINGROWS= 3000;
RUN;
3 REPLIES 3
Patrick
Opal | Level 21

Without you sharing the SAS code and SAS log there isn't much we can say.

IF you share a SAS log then please from a new SAS session so that no "left-overs" impact the result.

Patrick_0-1649024579563.png

In case your actual code really looks like above then that wouldn't work.

abrice520
Obsidian | Level 7

It doesn't actually look like that, I had to censor the pathway name due to HIPAA restrictions. I've tried it with multiple lines of code. This is what I get each time. This specific example is from my first line of code (the X's are indicating censored info, hopefully that makes it more clear, it's nothing different from a normal LIBNAME statement)

LIBNAME CapSrc "XXXXXXXXXXXXXXx";

 

abrice520_0-1649031248209.png

 

 

 

ballardw
Super User

Restart your SAS session. Something has rendered unstable. That "something" is likely what ever triggered SAS to think you have a macro function call somewhere.

 

When you run code and nothing happens, then SAVE the code and restart SAS as the program is not unstable.

 

Without an exact example of the comment you mentioned with a % can't say if that was the issue.

 

If your file names or paths have % or & characters then that is suboptimal and you should consider removing them.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 4951 views
  • 0 likes
  • 3 in conversation