DATA Step, Macro, Functions and more

Physical file does not exist

Posts: 0

Physical file does not exist

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\ 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_&" lrecl=2000;
Super User
Posts: 3,106

Re: Physical file does not exist

A Windows server (I guess this is what you want) directory can be referenced like so:


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!.
Respected Advisor
Posts: 3,892

Re: Physical file does not exist


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.
Ask a Question
Discussion stats
  • 2 replies
  • 3 in conversation