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