hi,
so i just got pc files server installed and i read many articles saying one should be able to access pc files from unix sas .
I have SAS 64bit and Ofifce 32 bit
i tried my code on pc sas first and it worked:
PROC IMPORT DATATABLE=SLOCCov DBMS=ACCESSCS OUT=TEMP1 REPLACE;;
DATABASE="Y:\xx\yyy\zzz.accdb";
DBDSOPTS='READBUFF=30';
RUN;
but then when i ran it on EG SAS(Remote) i got an error
PROC IMPORT DATATABLE=SLOCCov DBMS=ACCESSCS OUT=TEMP1 REPLACE;;
DATABASE="Y:\xx\yyy\zzz.accdb";
PORT=9261;
SERVER="xyz.abc.com";
DBDSOPTS='READBUFF=30';
RUN;
ERROR: A socket routine returned error: The connection was refused.
ERROR: Failed to connect to the Server: *******.com.
1. Can i really import pc files into UNIX SAS?
2.Name of server will be my computer name right?
3. Any insights on this error please
thx
Hi @Tal,
1) yes you can.
2) The name of the server should be the name of the server running the pc files server. On that server it will listen to the configured port, in your case 9261.
3) I would start with validating the network connectivity:
* Are server name and port correct?
* Is there basic network connectivity between the two (they may be on different networks). Use the ping command on the Linux machine to test that.
ping xyz.abc.com
* Use telnet (if availble) on the Linux host to determine if you can reach the port on the pc files server
ftp xyz.abc.com 9261
* If these tests do not indicate a working connection, there may be a firewall on either machines or en route that may block your traffic. Discuss with your network staff.
Only if this checks out (which I think it will not do), you can look into the SAS side of things.
Let us know how you fare.
Kind regards,
- Jan.
Thanks Jan
i did the ping test and it never stopped pinging 🙂
i did the telnet test and connection to 6291 was refused but i could reach 6921 and i someone mentioned i should use this port so still a possible firewall issue ?
If I'm not mistaken the Linux should not need access to the path. It is validated and accessed on the Windows server. On that server it should be a valid path, either by drive letter or UNC.
You mentioned port to 9261 in your initial post. Make sure you use the one that the pc files server is configured to listen to. If telnet gives a "connection refused" your best bet would be the firewall.
DATABASE="Y:\xx\yyy\zzz.accdb";
Y (if pointing to a network share) seems to be a drive letter validated only by your PC. Try to use universal network address instead, such as \\share\blah\xx\yyy\zzz.accdb
hey Haikuo yes i changed the map to reflect the absolute path not the path UNIX cannt recognize
thank you
so i changed the path and also added the credentials i use to log into windows and changed the port to 9621 as advised by some of the guys in different depts who has used it
PROC IMPORT OUT= TEMP DATAFILE= "\\aaa\vv\bbb\tt\ccc\dd\Book1.xlsx" DBMS=EXCELCS REPLACE;
PORT=9621;
SERVER="xyz.abc.com";
SHEET='Sheet1';
SERVERUSER='domain\userid';
SERVERPASS='****';
RUN;
and the error :
ERROR: Server is unable to authenticate user credentials. (missing or invalid SERVERUSER='<domain\username>';
SERVERPASS='<password>'; enclosed in quotes).
so looks like i dont have the right SERVER's name above huh?
ps.this is an excel file import as oopose the access i initially had posted
Make sure 'domain\userid' has the write access to "\\aaa\vv\bbb\tt\ccc\dd". You may need check with your network folks who manage the active domain.
hello
@Haikuo i do have read/write access to that drive
"Special Permisisons " is checked under "Permissions" but i can save,delete,read in this folder
@Jan
9621 is the right port i checked that and it connects
ftp "Txyz.abc.com" 9621
Connected to xyz.abc.com.
i did the ping test again and it never stops
64 bytes from ****: icmp_seq=4 ttl=121 time=7 ms
64 bytes from ****: icmp_seq=5 ttl=121 time=6 ms
64 bytes from ****: icmp_seq=6 ttl=121 time=6 ms
............................
..............................
i ran these again:
PROC IMPORT OUT= TEMP DATAFILE= "\\aaa\vv\bbb\tt\ccc\dd\Book1.xlsx" DBMS=EXCELCS REPLACE;
PORT=9621;
SERVER="xyz.abc.com";
SHEET='Sheet1';
SERVERUSER='domain\userid';
SERVERPASS='******';
RUN;
ERROR: Server is unable to authenticate user credentials. (missing or invalid SERVERUSER='<domain\username>'; SERVERPASS='<password>'; enclosed in quotes).
libname mylib pcfiles
path="\\aaa\vv\bbb\tt\ccc\dd\Book1.xlsx"
server="xyz.abc.com";
port=9621
SERVERUSER='domain\userid'
SERVERPASS='*****';
ERROR: Server is unable to authenticate user credentials. (missing or invalid SERVERUSER=<username> SERVERPASS=<password> on libname statement).
I am clueless 😞
ERROR: Server is unable to authenticate user credentials. (missing or invalid SERVERUSER='<domain\username>'; SERVERPASS='<password>'; enclosed in quotes).
This shows your credential is not accepted by the server "xyz.abc.com, the one runs SAS pcfiles server. Do you have a SAS admin managing your permission?
trying to find out if the server's name i have specified in the code here matches the server's name the pc files server is installed on.
i am using my computer's name a sa server name
managing my permission as in not able to access remote servers or something like it?
Are you saying you are using your PC as remote server running SAS pcfiles server? In that case, you need to make sure you have permisson to remote into your own PC. Yes, it sounds wierd, but local permission to your PC does NOT grant your remote permission to the same box automatically. You will need network security folks to fix that. At least, you will need to have admin access to your own pc to make some changes.
yes, i am running EG SAS Remote to access files from my network drives and import them into UNIX.
i thought
SERVERUSER='domain\userid'
SERVERPASS='****';
is how i access my laptop from the unix sas sever,no?
The credential above is my windows login
So you are running PC Files server on your laptop?
Does EG connect to SAS running on your PC also? Or to some other machine? Is that machine running Windows or Unix?
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.