ERROR: Physical file does not exist

Reply
Occasional Contributor
Posts: 5

ERROR: Physical file does not exist

The filename itself can cause this error.  In this example, the sq at the beginning of the filename caused the error.

Filename sql_sas_test.xlsx caused

ERROR: Physical file does not exist, C:\Users\abc1234\AppData\Local\Temp\SEG7140'l_sas_test-5f2bb2073645403abf202063d7bf4130.txt.  Note: The SAS System stopped processing this step because of errors.  Warning: The data set WORK.SQL_SAS_TEST may be incomplete. When this step was stopped there were 0 observations and 16 variables.

Rename the file as sas_test_sql.xlsx and the file opens ok

NOTE: The infile 'C:\Users\abc1234\AppData\Local\Temp\SEG7140\sas_test_sql-3215f6df613742f2860a81d5e79b4c89.txt' is: Filename=C:\Users\abc1234\AppData\Local\Temp\SEG7140\sas_test_sql-3215f6df613742f2860a81d5e79b4c89 Note: 84 records were read from the infile

SAS did not like the sq in the beginning of a filename.

On standlone pc, SAS Enterprise Guide Version 4.3 (4.3.0.10196).

Grand Advisor
Posts: 10,210

Re: ERROR: Physical file does not exist

If this was the file name:

C:\Users\abc1234\AppData\Local\Temp\SEG7140'l_sas_test-5f2bb2073645403abf202063d7bf4130.txt.

then the ' instead of a \ meant that was looking for the file in the TEMP folder.

Occasional Contributor
Posts: 5

Re: ERROR: Physical file does not exist

That's correct, SAS changed the file path to look for a file in the TEMP folder. The sq at the beginning of the filename caused SAS to read SEG7140'l_sas_test instead of SEG7140\sas_test_sql

Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: ERROR: Physical file does not exist

Yes, you have shown the error yourself:

C:\Users\abc1234\AppData\Local\Temp\SEG7140'l_sas_test-5f2bb2073645403abf202063d7bf4130.txt

C:\Users\abc1234\AppData\Local\Temp\SEG7140\sas_test_sql-3215f6df613742f2860a81d5e79b4c89.txt


Note in the first instance between SEG7140 and the filename l_sas_test... you have a single quote.  This should be a \ per delimiter.

Occasional Contributor
Posts: 5

Re: ERROR: Physical file does not exist

Correct, I was simply adding this as comments to the Discussions forum for future reference.  Using SAS Enterprise Guide File, Open, Data C:\Users\abc1234\WorkDir\sql_sas_test.xlsx    SAS converted this file path into C:\Users\abc1234\AppData\Local\Temp\SEG7140'l_sas_test as shown in the SAS Log tab.

Esteemed Advisor
Esteemed Advisor
Posts: 7,203

Re: ERROR: Physical file does not exist

Really, using sq in a filename does not work.  Can I ask what software you are using/how you are importing to be specific, as running this code:

filename tmp "s:\temp\rob\sql_sas_test_sql-3215f6df613742f2860a81d5e79b4c89.txt";

data temp;

  infile tmp;

  input a $;

run;

Worked fine for me in  9.3.

Occasional Contributor
Posts: 5

Re: ERROR: Physical file does not exist

Good point RW9, I have SAS 9.2 and SAS Enterprise Guide 4.3.  Error occurs with 4.3 did not use 9.2.

Ask a Question
Discussion stats
  • 6 replies
  • 748 views
  • 0 likes
  • 3 in conversation