0
votes

I am trying to use PROC EXPORT in SAS Enterprise Guide 6.1, through the Citrix environment, to send datasets to Excel, however seem to be having problems with the paths of the files.

The code that I have is as follows:

proc export data = work.Test
outfile = '\\servername\path\Test.xls' 
dbms =  xls replace;
sheet = "Test";
run;

The error message that I receive is "ERROR: Insufficient authorization to access /sasconfig/compute/ciapp/Lev1/CIApp/\servername\path\Test.xls."

The path I am providing is being appended to another path that I have not defined. Note, the server name is not an alias such as "C:", it is actually the path of the server, but I have removed it for confidentiality.

If I change the line to:

outfile = 'H:/Test.xls'

the error message is "ERROR: Physical file does not exist, /sasconfig/compute/ciapp/Lev1/CIApp/H:/Test.xls"

but if I change the line to:

outfile = '/Test.xls'

the error message is "ERROR: Insufficient authorization to access /Test.xls."

I think I fundamentally am not understanding the file paths that SAS is trying to use. What am I doing wrong/how can I determine a path where I can actually export an Excel file to?

2

2 Answers

2
votes

Citrix is probably using UNIX style paths instead of Windows style paths. So instead of \\servername\path you would use //servername/path. h:\ might also be correct (but not h:/) if your SAS server has h:\ defined (not the EG location - has to be where sas.exe actually runs).

2
votes

SAS EG is an interface to work on a server. If your data resides on the server, you would need to find the full network path to your computer's C drive. Otherwise, you could just change the server in EG to "local" and run everything locally so it would recognize the paths as local.

So if you have a shared drive user (typically not C:), that you can read/write to, you can use properties of a folder on that shared drive to retrieve full path and use that to export. Similarly, you should be able to open network, find the network name of your PC on there and use a relative path like \sharedservername\users\yourusername\subfolder\path\ as an export path.

You can also look at SAS EG's Export wizard's automatically generated code for a dummy export to your path and reuse that code. It will probably retrieve and write the appropriate full path for you.