Desktop productivity for business analysts and programmers

Libname Not Resolving Using Enterprise Guide Prompt

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 7
Accepted Solution

Libname Not Resolving Using Enterprise Guide Prompt

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


Accepted Solutions
Solution
‎11-30-2017 02:00 PM
Occasional Contributor
Posts: 7

Re: Libname Not Resolving Using Enterprise Guide Prompt

Posted in reply to ICI_SAS_Admins

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


All Replies
PROC Star
Posts: 1,265

Re: Libname Not Resolving Using Enterprise Guide Prompt

Posted in reply to ICI_SAS_Admins

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

Solution
‎11-30-2017 02:00 PM
Occasional Contributor
Posts: 7

Re: Libname Not Resolving Using Enterprise Guide Prompt

Posted in reply to ICI_SAS_Admins

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(%");

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 243 views
  • 0 likes
  • 2 in conversation