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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

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
  • 9045 views
  • 0 likes
  • 4 in conversation