BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ICI_SAS_Admins
Fluorite | Level 6

I am submitting the following code using a prompt in Enterprise Guide 7.13 HF5 being sent to process on a Solaris 64-bit 9.4M2 Unix SAS server:

 

%put &libby;

libname pully &libby;

 

The prompt appears to be resolving for the put statement but something weird is happening for the libname statement giving me the following log:

 

39
40 %put &libby;
"/sas/data/research/Retirement/Permanent Datasets/"
41
42 libname pully &libby;
ERROR: Libref in LIBNAME statement must be followed either by quoted string or engine name or semicolon; """ found.
ERROR: Error in the LIBNAME statement.

 

Can anyone explain why this is not working?

 

-Shaun

1 ACCEPTED SOLUTION

Accepted Solutions
ICI_SAS_Admins
Fluorite | Level 6

Thank you for the suggestions.  They led me to the answer as found in another posting https://communities.sas.com/t5/SAS-Enterprise-Guide/Syntax-Error-Quotes-in-Macro-Parameter-Generated...

 

The solution was to add the %unquote to the code as follows:

 

%put &libby;

libname pully %unquote(&libby);

 

This is apparently due to Enterprise Guide adding something to the prompt as can be seen in another line of the log that I missed:

 

10 %LET libby = %nrstr(%")/sas/data/research/Retirement/Permanent Datasets/%nrstr(%");

 

View solution in original post

2 REPLIES 2
TomKari
Onyx | Level 15

I tried your code, and it worked fine for me.

 

My suspicion is that there's an unprintable character in your macro variable contents somewhere, I would suspect right after the initial double quote from what your log is saying.

 

Tom

ICI_SAS_Admins
Fluorite | Level 6

Thank you for the suggestions.  They led me to the answer as found in another posting https://communities.sas.com/t5/SAS-Enterprise-Guide/Syntax-Error-Quotes-in-Macro-Parameter-Generated...

 

The solution was to add the %unquote to the code as follows:

 

%put &libby;

libname pully %unquote(&libby);

 

This is apparently due to Enterprise Guide adding something to the prompt as can be seen in another line of the log that I missed:

 

10 %LET libby = %nrstr(%")/sas/data/research/Retirement/Permanent Datasets/%nrstr(%");

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

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
  • 2 replies
  • 2420 views
  • 0 likes
  • 2 in conversation