BookmarkSubscribeRSS Feed
RachanaT
Calcite | Level 5

Hi All, 

can we define libname like libname mylib "$abc";  i m not sure if this is a valid format.

 

Thank you in Advanced

4 REPLIES 4
PaigeMiller
Diamond | Level 26

If you are not sure if something is valid, TRY IT in SAS and you will find out.


What is $abc, and why would you want it in a LIBNAME statement?

--
Paige Miller
Kurt_Bremser
Super User

If your SAS session runs on a UNIX platform, and an environment variable named abc (case sensitive!) was defined at SAS startup, and it contains a valid path, this can work.

Tom
Super User Tom
Super User

@Kurt_Bremser wrote:

If your SAS session runs on a UNIX platform, and an environment variable named abc (case sensitive!) was defined at SAS startup, and it contains a valid path, this can work.


Right.

Or if you use the SET option create the environment variable.

options set=abc=/home/me/abc ;
libname abc "$abc";
Oligolas
Barite | Level 11

Under Windows you can also refer to environment variables through SAS.

For example like this:

libname test "!TMP";*refers to the environment variable %TMP% if defined;
libname test clear;
________________________

- Cheers -

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 4 replies
  • 623 views
  • 2 likes
  • 5 in conversation