BookmarkSubscribeRSS Feed
deleted_user
Not applicable
This is not a repost.
Basically I want to create a file on the server. I tried creating teh file on my C drive and it works fine. But how do I change the code to create a file on the server?
When I tried replacing C drive with the server address, it gives an error:
Physical file does not exist, C:\serveraddr\test.sa_2010_08_04.sas. I am not sure why it points to the C drive? I thought because I am tetsing on PC SAS , it must be pointing to C drive, so I used a ' rsubmit %dbcon' statement before and after, but it still did not work.

data _null_;
set mydata.schd end=eof;
file "C:/test.sa_&dt..sas" lrecl=2000;
2 REPLIES 2
SASKiwi
PROC Star
A Windows server (I guess this is what you want) directory can be referenced like so:

\\serveraddress\dir\subdir1\subdir2

I find the best way to get a server directory is to map to the server in Windows Explorer, locate the directory I want to reference, then copy the full path from the Explorer address line and paste it into the SAS LIBNAME. That way no typos!.
Patrick
Opal | Level 21
Hi

If you execute your code on the server then you must think from then disks must be addressed how the servers sees them.

c:\... would then just be a file on the local server disk - and you as a user shouldn't have write permission there.

Using a unc path \\serveraddress\..... is a way to access shared disks via the network. That's where you should store you stuff. There is a big chance that you'll also be able to map such a share on your PC and so access the server generated output directly via Windows Explorer on your PC.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 1689 views
  • 0 likes
  • 3 in conversation