Learning SAS? Welcome to the exclusive online community for all SAS learners.

Having Error when trying to execute Infile statement

Reply
New Contributor
Posts: 3

Having Error when trying to execute Infile statement

HI,

I am getting the below error, when i try to excecute infile statement.

 

I have also set up a shared folder 

 

ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/C:\SASUniversityEdition\Myfolder\name.csv.

 

Attached is the snap shot.

 

Kindly help me. I am using windows.

 

Regards,
Balaji


sAS error.jpg
Occasional Contributor
Posts: 12

Re: Having Error when trying to execute Infile statement

Posted in reply to balajivnp

Hi,

 

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.

Super Contributor
Posts: 345

Re: Having Error when trying to execute Infile statement

Posted in reply to balajivnp

When using SAS UE all paths start with /MyFolder and you have to use / instead of \ as separator.

New Contributor
Posts: 3

Re: Having Error when trying to execute Infile statement

Posted in reply to andreas_lds

Hi Andreas,

 

I changed the code as said and below is the same.

 

data getdata;
infile 'C:/SASUniversityEdition/Myfolder/name.csv' dlm=' ' dsd missover firstobs=2;
input Name $ Age;
proc print;
run;

 

but still i get the below error in the log file

 

ERROR: Physical file does not exist, /opt/sasinside/SASConfig/Lev1/SASApp/C:/SASUniversityEdition/Myfolder/name.csv.

 

Kindly help.

 

Regards,
balaji

 

Occasional Contributor
Posts: 12

Re: Having Error when trying to execute Infile statement

Posted in reply to balajivnp

Hi Balaji,

 

please goi through bellow link . it will help u

Occasional Contributor
Posts: 12

Re: Having Error when trying to execute Infile statement

Posted in reply to Madansas7b

Hi Balaji,

 

/opt/sasinside/SASConfig/Lev1/SASApp/path/Pgm1ExtInp.txt.

 

because your version of SAS University Edition is looking for the file *INSIDE* the virtual machine. that location in pink above is the "inside the VM" default path. So SAS is appending your INFILE location with the "inside" location. You used an INCORRECT infile statement and so, SAS had no choice but to look *INSIDE* the VM for the file.

 

please goi through bellow link . it will help u.

 

https://communities.sas.com/t5/General-SAS-Programming/SAS-University-Edition-Reading-Files-From-Har...

New Contributor
Posts: 3

Re: Having Error when trying to execute Infile statement

Posted in reply to Madansas7b

Hi,

 

I tried, but i am getting the same error. below is the code:

 

%let path= C:/SASUniversityEdition/Myfolder;
data getdata;
infile "&path/name.csv" dlm=' ' dsd missover firstobs=2;
input Name $ Age;
proc print;
run;

 

Also attached is the snap shot of the configuration done in vm Virtual box for the shared folder.

 

Kindly assist.

 

thanks in advance

 

Regards,
balaji

 


sAS error.jpg
Super User
Posts: 19,878

Re: Having Error when trying to execute Infile statement

Posted in reply to balajivnp

Go back and read that post from Cynthia, line by line please. 

The instrructuons are there. Or search out multiple posts like this in Analytics U forum - and I'll move your question there as well. 

 

 

Super User
Super User
Posts: 7,081

Re: Having Error when trying to execute Infile statement

[ Edited ]
Posted in reply to balajivnp

SAS UE is running in a virtual Unix machine. Because if this it cannot see your Windows paths. 

 

When you installed SAS UE you told your virtual machine software to map your Windows path 

 C:\SASUniversityEdition\Myfolder

to this location in the Unix file system.

/folders/myfolders

So in your SAS code you need to use the Unix path to the files.  

%let path= /folders/myfolders ;
data getdata;
  infile "&path/name.csv" truncover firstobs=2;
  input Name $ Age;
run;
Ask a Question
Discussion stats
  • 8 replies
  • 294 views
  • 0 likes
  • 5 in conversation