07-19-2012 12:03 PM
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.
03-08-2017 11:53 AM
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.
07-19-2012 05:44 PM
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.
07-20-2012 08:51 AM
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,
07-20-2012 11:00 AM
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.
07-20-2012 11:08 AM
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.
07-20-2012 11:47 AM
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.
07-20-2012 11:58 AM
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.
07-20-2012 12:53 PM
07-20-2012 02:17 PM
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.
Need further help from the community? Please ask a new question.