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

I'm trying to use a Libname in a proc export and no matter what I do I get the

Apparent symbolic reference not resolved error> Any help greatly appreciated.

 

libname outy "H:\SAS Code";

 

PROC EXPORT DATA= WORK.CMFY_ProvSpecE_people

OUTFILE= "&outy.CMFY_ProvSpec_East_&date..csv"

DBMS=CSV REPLACE;

PUTNAMES=YES;

RUN;

 

Thanks,

 

Brian

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

That's not how a libname is referenced. A libname is used to reference SAS datasets not paths, note the addition of the (\). 

I think you want a MACRO variable.

 

%let outy = H:\SAS Code;
 
PROC EXPORT DATA= WORK.CMFY_ProvSpecE_people
OUTFILE= "&outy.\CMFY_ProvSpec_East_&date..csv"
DBMS=CSV REPLACE;
PUTNAMES=YES;
RUN;

View solution in original post

6 REPLIES 6
Reeza
Super User

That's not how a libname is referenced. A libname is used to reference SAS datasets not paths, note the addition of the (\). 

I think you want a MACRO variable.

 

%let outy = H:\SAS Code;
 
PROC EXPORT DATA= WORK.CMFY_ProvSpecE_people
OUTFILE= "&outy.\CMFY_ProvSpec_East_&date..csv"
DBMS=CSV REPLACE;
PUTNAMES=YES;
RUN;
BTAinRVA
Quartz | Level 8
Reeza,

Thanks! I keep getting mixed up on that.
ballardw
Super User

It helps to show the entire code. Symbolic reference often referrs to the macro variables.

 

OUTFILE wants things in the form of an operating file system. The LIBRARY is not valid or going to be used in this case.

OUTFILE= "H:\SAS Code\CMFY_ProvSpec_East_&date..csv"

 

OR

 

%let Outy = H:\SAS Code\"; to use the way you attempted.

 

Also you would need the \ unless the folder's name is SAS CodeCMFY_ProvSpec_East_&date

BTAinRVA
Quartz | Level 8
ballardw,

Thanks for the reply!
Astounding
PROC Star

Your program is referring to two macro variables:  &OUTY and &DATE

 

The error message is saying that at least one of these has not been defined.  You can get a list of all user-defined macro variables with a single statement:

 

%put _user_;

 

Once  you see which are defined and which are not, you can handle this error.  There may be additional errors after that, if PROC EXPORT detects them.  But the first step is to eliminate the current error which is one (or two) of your macro variables not being defined in time.

BTAinRVA
Quartz | Level 8
Astounding,

Thanks for the quick reply!

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
  • 6 replies
  • 9903 views
  • 0 likes
  • 4 in conversation