ERROR: Physical file does not exist?

Accepted Solution Solved
Reply
Contributor
Posts: 60
Accepted Solution

ERROR: Physical file does not exist?

Hi,

I`m trying to read a large text file using infile statement.

When i ran the code, i encountered this error. "ERROR: Physical file does not exist".

I checked the location and see the file is there.

Your help is greatly appreciated.

Thanks,

Saravanan


Accepted Solutions
Solution
‎03-08-2017 11:54 AM
SAS Employee
Posts: 22

Re: ERROR: Physical file does not exist?

This error message can result from many situations.  While @robby_beum ultimately solved the problem for this specific situation, @ballardw also mentioned one of the most common causes.  To close this issue, I will summarize below some likely causes of getting

ERROR: Physical file does not exist.

 

  • Any part of the path or filename is misspelled
  • The directory or subdirectory does not exist
  • The drive may not be mapped to the correct location
  • Permission issues
  • Server issues
  • Special characters or spaces are used in the directory or filename where they are not supported

 

View solution in original post


All Replies
Grand Advisor
Posts: 10,210

Re: ERROR: Physical file does not exist?

Please provide the FILENAME statement if used or the INFILE statement.

The most likely problem is a typo in the path or filename, or if using a macro the resolved macro filename or infile has a problem.

Contributor
Posts: 60

Re: ERROR: Physical file does not exist?

Hi, The FILENAME statement is used as given,

      filename in "Q:\Data\Original\2010\Decrypted\MDS_Qtr\201204(Apr)\2011Q1\QWU_J67455_P1_Custom.txt" lrecl=1274;

               infile in dsd truncover;

The Q: is on server and it is mapped to my computer. This is how it reads,

computer\tmstua(\\sas-2003)(QSmiley Happy\Data\Original\2010\Decrypted\MDS_Qtr\201204(Apr)\2011Q1

Thanks

Contributor
Posts: 63

Re: ERROR: Physical file does not exist?

In addition to verifying visually that the file exists in the directory you're referencing, can open and view the file in a text editor?

I'm wondering if the parenthesis in the filename are causing a problem.  I've never seen those used before. The only special characters I can recall seeing in a path are the underscore and dash.

I'd say create the exact same directory structure on your C: drive or another mapped drive but without the ( ) characters and copy the file there.  Then change the filename statement and see what happens.

Good luck.  This is a curious one.  Be sure to let us know what you figure out.

Contributor
Posts: 60

Re: ERROR: Physical file does not exist?

The data is too large to be opened in a text editor. I have tried creating the same directory structure in my C: drive and it works perfectly.

Q: drive is on the server and it is mapped to my computer. When i try to access Q:drive, it doesn`t work. I`m baffled.

Thanks.

Contributor
Posts: 63

Re: ERROR: Physical file does not exist?

Very curious.  I created a directory on my LAN with (Apr) in the path, put a text file there, created a filename pointing to it, and it worked just fine.

Except that I mistyped the path the first run and it returned the file not exists error.  To be sure, I went into Windows Explorer and copied and pasted the directory path and filename into the filename statement.  It worked then.  Have you done that or did you type it in.

You have a long path and filename, and I see the path has directories for years 2010, 2012, and 2011 in it.  Looks confusing.  Are those all correct?

Ballardw suggested earlier it's a typo.

Contributor
Posts: 60

Re: ERROR: Physical file does not exist?

To avoid typos i copy pasted the path and file name from windows explorer.

It works fine with same directory structure in other drives except for Q: drive.

I`m not sure why it is not working for Q: drive.

Thanks.

Frequent Contributor
Posts: 84

Re: ERROR: Physical file does not exist?

make sure that the file is closed when you run the code, sometimes if the file is open by another program, this may happen

Contributor
Posts: 60

Re: ERROR: Physical file does not exist?

File is closed and it is not used by anyother program. Much appreciated.

Super Contributor
Posts: 1,636

Re: ERROR: Physical file does not exist?

maybe there are two many subdirectories?

I had problem to get files from the subdirectories of

"\\Fhs-srv-array1\Users\www\my documents\From my old computer"

after changing

"\\Fhs-srv-array1\Users\www\my documents\From my old computer"

to a letter drive (YSmiley Happy it worked fine.

Contributor
Posts: 60

Re: ERROR: Physical file does not exist?

I should try that.Thanks.

Contributor
Posts: 63

Re: ERROR: Physical file does not exist?

I'm afraid I'm stumped on this one.

Valued Guide
Posts: 2,111

Re: ERROR: Physical file does not exist?

Are you running SAS locally or on the server?  If you are running on the server, it may require different drive mappings than you have on your local PC.

Contributor
Posts: 60

Re: ERROR: Physical file does not exist?

I`m running SAS on server. I have other drives which is mapped the same way as Q: drive. There is no such problem when pulling data from other drives which is also mapped similar to Q: drive.

I don`t know why it is not working.

Super Contributor
Posts: 1,636

Re: ERROR: Physical file does not exist?

Hi,

save a simple file to the same location to try to read it.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 26 replies
  • 36374 views
  • 1 like
  • 11 in conversation