BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kmardinian
Quartz | Level 8

I am trying to upload an excel file that is located in the Input folder on a server. For some reason though, every time I try to import it, it remaps the path to the Prog folder instead. Any help is greatly appreciated. Thank you!

 

 

 

 

91   %let input1=&root\data\Input;
92   %put input1=&input1;
input1=\\SERVER.XX.COM\E\PROJECT WORK\FULL SERVICE\YY\STAT\data\Input
93   libname input1 "&input1";
NOTE: Libref INPUT1 was successfully assigned as follows:
      Engine:        V9
      Physical Name: \\SERVER.XX.COM\E\PROJECT WORK\FULL SERVICE\YY\STAT\data\Input

94   proc import out=input1.PP datafile='E\Project Work\Full Service\YY\STAT\Blinded\TFL\Data\Input\PP.xlsx' dbms=xlsx replace;
95       getnames=yes;
96   run;

ERROR: Physical file does not exist, \\server.xx.com\E\Project Work\Full Service\YY\STAT\Prog\E\Project Work\Full Service\YY\STAT\Data\Input\PP.xlsx.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.17 seconds
      cpu time            0.00 seconds


1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

So your first step shows that this directory exists:

 \\SERVER.XX.COM\E\PROJECT WORK\FULL SERVICE\YY\STAT\BLINDED\TFL\data\Input

Your second step shows that this file does NOT exist.

                E:\Project Work\Full Service\YY\STAT\Blinded\TFL\Data\Input\PP.xlsx

Can you see the differences?

Assuming that case doesn't matter you could try:

datafile="&root\data\Input\PP.xlsx"

View solution in original post

9 REPLIES 9
Kurt_Bremser
Super User

Since you gave a relative path for the datafile, SAS started to look in the current working directory of the SAS process, which seems to be \\server.xx.com\E\Project Work\Full Service\YY\STAT\Prog

ballardw
Super User

If the file you are referencing is supposed to be on YOUR E drive then perhaps instead of

proc import out=input1.PP datafile='E\Project Work\Full Service\YY\STAT\Blinded\TFL\Data\Input\PP.xlsx' 

you want

 

proc import out=input1.PP datafile='E:\Project Work\Full Service\YY\STAT\Blinded\TFL\Data\Input\PP.xlsx' 

 

 

If you are working in a server environment the path to the XLSX file has to be from the server perspective and it may not have a drive E.

If you aren't working with a SAS server then I would navigate to the location in Windows Explorer or similar drive navigation tool and ensure that the complete path is as you have. In windows explorer I usually click on the "path" section and copy/paste into the SAS editor to get the exact path seen from my computer.

kmardinian
Quartz | Level 8

Hi, thanks for your help! So the server does have the E drive in it. I tried running it with the code you showed me, but it still doesn't seem to be finding the file even though now the path is correct.

 


78   libname input1 "&root\data\Input";
NOTE: Libref INPUT1 was successfully assigned as follows:
      Engine:        V9
      Physical Name: \\SERVER.XX.COM\E\PROJECT WORK\FULL SERVICE\YY\STAT\BLINDED\TFL\data\Input
79
80
81   proc import out=input1.PP datafile='E:\Project Work\Full Service\YY\STAT\Blinded\TFL\Data\Input\PP.xlsx' dbms=xlsx replace;
82       getnames=yes;
83   run;

ERROR: Physical file does not exist, E:\Project Work\Full Service\YY\STAT\Blinded\TFL\Data\Input\PP.xlsx.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
      real time           0.08 seconds
      cpu time            0.01 seconds

kmardinian
Quartz | Level 8

The file is there, I have checked multiple times. I am just not sure whether SAS knows to look for an excel file.

Kurt_Bremser
Super User

Read my post again. IT'S.NOT.THERE. At least not where SAS is looking. Keep in mind that a local path on your desktop is most probably invisible to the server.

kmardinian
Quartz | Level 8

The line of code works perfectly fine for others that are connected to the server the same way that I am.

Kurt_Bremser
Super User

@kmardinian wrote:

The line of code works perfectly fine for others that are connected to the server the same way that I am.


Then look at the differences between the users involved. There is one. Different permissions, different login scripts, network shares not or differently mounted, ...

 

When SAS says the file ain't there, it ain't there (for the SAS process to access). What I tell you three times is the truth.

Tom
Super User Tom
Super User

So your first step shows that this directory exists:

 \\SERVER.XX.COM\E\PROJECT WORK\FULL SERVICE\YY\STAT\BLINDED\TFL\data\Input

Your second step shows that this file does NOT exist.

                E:\Project Work\Full Service\YY\STAT\Blinded\TFL\Data\Input\PP.xlsx

Can you see the differences?

Assuming that case doesn't matter you could try:

datafile="&root\data\Input\PP.xlsx"

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 9 replies
  • 980 views
  • 0 likes
  • 4 in conversation