BookmarkSubscribeRSS Feed
siliconcreature
Calcite | Level 5
Hi there,

can you make this code work?

%let dir = "C:\";
libname c &dir;
7 REPLIES 7
siliconcreature
Calcite | Level 5
I mean this works under sas/windows, but not working with sas UNIX
RickM
Fluorite | Level 6
I haven't used UNIX in years (and never for SAS) but I thought UNIX uses the forward slash '/' for pathnames while the default in windows is the backslash( though it will accept the forward slash as valid) so try switching it in your program.
DBailey
Lapis Lazuli | Level 10
Are you perhaps trying to get your unix server based sas to see a directory on your local windows machine? I don't think that will work unless the sas server can "see" your local machine. There are some technologies that can let that happen, but the path would not be "c:\", it would be however your local drive was mounted to the unix server.
Ksharp
Super User
How about:
[pre]
%let dir = C:\;
libname c "&dir";

[/pre]


Ksharp
Ksharp
Super User
How about:
[pre]
%let dir = C:\;
libname c "&dir";

[/pre]


Ksharp
siliconcreature
Calcite | Level 5
your way is working, thank you.
PatrickG
SAS Employee
Yeah, don't use the double quotes. With the double quotes around it, the %let stores them (along with the good stuff inside) in the symbol table...

15 %let dir = "C:\";
16 %put &dir;
"C:\"

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
  • 7 replies
  • 10587 views
  • 0 likes
  • 5 in conversation