BookmarkSubscribeRSS Feed
Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

pc files server running on my laptop(windows machine)

EG SAS runs on my laptop too but SAS Remote (UNIX)

Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

so this  actually  works  if  trying  to access  files  from EG SAS located in my  c drive:

 

proc import out= temp datafile= "C:\Users\Redirection\userid\Desktop\book1.xlsx" dbms=excelcs replace;

port=9621;

server="XYZ12345678";

sheet='Sheet1';

run;

 

So i guess no way files in the  share drives  can be  accessed ?

Tom
Super User Tom
Super User

In theory it should work.  As long as the PC files server process can access the share drive. Which if it is running on your PC then I assume that means if you can access the shared drive.

 

You should be able change the path to use the UNC path to the shared drive.  So if there is a file name 'somebook1.xlsx' in a folder named 'somefolder' on the shared drive that is shared as '\\servername\sharename' then the code would look like this.

 

proc import out= temp replace
  dbms=excelcs 
  datafile= "\\servername\sharename\somefolder\somebook1.xlsx"
;
  port=9621;
  server="XYZ12345678";
  sheet='Sheet1';
run;
 

 

Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

thanks Tom

i did  try it just now :

proc import out= temp datafile= " \\xxx\corp\yyy\TOR1\zzz\mm\Book1.xlsx" dbms=excelcs replace;

port=9621;

server="***";

sheet='Sheet1';

run;

 

 

 

ERROR: Unable to open file \\xxx\corp\yyy\TOR1\zzz\mm\Book1.xlsx. It does not exist or it

is already opened exclusively by another user, or you need permission to view its data.

 

i created Book1 and i can access it  ....

Go
Quartz | Level 8 Go
Quartz | Level 8

Hi Tal and Tom,

 

I have exactly same issue, could you resolve this ??

PROC EXPORT

DBMS=ACCESSCS

DATA=SASHELP.CARS

TABLE="CARS"

REPLACE;

DATABASE='\\WILPMVDFS01.juniper.com\Shared\SAS_Admin\Govardan\SASHELPCARS.ACCDB';

SERVER_NAME='WILPLM26266.juniper.com';

SERVERUSER='dryrock\gnayaki';

SERVERPASS='***;

PORT=9621;RUN;

DOESN’T WORK GIVES BELOW ERROR------

 

ERROR: Server is unable to authenticate user credentials. (missing or invalid SERVERUSER='<domain\username>';

       SERVERPASS='<password>'; enclosed in quotes)

PROC EXPORT

dbms=accesscs

data=sashelp.cars

table="cars"

replace;

database='C:\Users\gnayaki\Desktop\DESKTOP_june13\newcars1.accdb';

server='WILPLM26266.juniper.com';

port=9621;run;

WORKS FINE

Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

hey go,sorry i still dont  have  an answer to  that. Remove the

SERVERUSER='dryrock\gnayaki';

SERVERPASS='***;

 

from you code and  see if you  get the error  that i got. I can easily connect to my  c drive but not to the  share drives

Go
Quartz | Level 8 Go
Quartz | Level 8

I already tried this, infact I tried all the combinations you can think of 🙂 ... below is the error i get.... fyi i think we definitly need to provide our username and password if we want to access sharedrive, but we dont need credetilas when you are accessing C drive..becuase by default "local system account" is checked for PC Files Server..see attached screenshot ...

 

23 PROC EXPORT

24 DBMS=ACCESSCS

25 DATA=SASHELP.CARS

26 TABLE="CARS"

27 REPLACE;

28 DATABASE='\\Juniper.com\shared\sas_913\SAS_Admin\Govardan\SASHELPCARS.ACCDB';

29 SERVER_NAME='WILPLM26266.juniper.com';

30 PORT=9621;RUN;

Connection Failed. See log for details.

 


PCfiles.png
Tal
Pyrite | Level 9 Tal
Pyrite | Level 9

hmm

you have admin  rights to select the "check this account" then  with the pass and  user  you  have in your code and  try again?

I mean we dont  need credentials  to access the  share drives  then  i dont understand  why we would need to provide   them in the  proc import code

Go
Quartz | Level 8 Go
Quartz | Level 8

I dont have admin rights, and there is no way i can get admin rights in my organisation ..thats why I chose to provide usernmae/pw in my code... I understand what you are saying .. when you try to reach files in shared drive .. your logging in to your PC and manually reaching the sharedrive/folders ... But when you run code in SAS/EG ... connection is intiating from "UNIX"-->PCFiles-->Networkdrive... may thats why..

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

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.

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
  • 23 replies
  • 6080 views
  • 0 likes
  • 5 in conversation