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.

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