- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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)(Q:)\Data\Original\2010\Decrypted\MDS_Qtr\201204(Apr)\2011Q1
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
make sure that the file is closed when you run the code, sometimes if the file is open by another program, this may happen
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
File is closed and it is not used by anyother program. Much appreciated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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 (Y:) it worked fine.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I should try that.Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I'm afraid I'm stumped on this one.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
save a simple file to the same location to try to read it.