DATA Step, Macro, Functions and more

Infile Statment Help

Reply
Occasional Contributor
Posts: 6

Infile Statment Help

DATA MYDATA;
INFILE 'E:\SASUniversityEdition\myfolders\Essentials\EXAMPLE.CSV' DLM=',' FIRSTOBS=2 OBS=11;
INPUT GROUP $ AGE TIME1 TIME2 TIME3 Time4 SOCIO;
PROC PRINT DATA=MYDATA;
RUN;

 

 

After running this my SAS is showing that the physical file does not exist, Although the file is there at the specified location in INFILE statement.Can anybody help me with this.....!

Trusted Advisor
Posts: 1,831

Re: Infile Statment Help

Posted in reply to Nikhil_1393

TRY

INFILE 'myfolders\Essentials\EXAMPLE.CSV' DLM=',' FIRSTOBS=2 OBS=11;
Occasional Contributor
Posts: 6

Re: Infile Statment Help

It still is not working......!

Occasional Contributor
Posts: 8

Re: Infile Statment Help

Posted in reply to Nikhil_1393

Do you connect to a server to run sas programs? It looks like you might, and if that is the case then the file path needs to be correct from the perspective of the server, not your own computer.

 

You would need to copy the input file from your computer to a shared drive or to the server itself. If you access a shared drive through a drive letter (eg. S:\ drive) then the server would need to have the exact same drive letter setup. If the server does not, you'll need to get the UNC path to the shared drive.

 

 

Super User
Posts: 9,890

Re: Infile Statment Help

Posted in reply to Nikhil_1393

It looks like you are using University Edition. In this case, the filename should be

infile '/folders/myfolder/Essentials/EXAMPLE.CSV' dlm=',' firstobs=2 obs=11;

Note that the underlying Linux of UE is case sensitive where filenames are concerned, so upper/lowercase needs to match exactly.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 4 replies
  • 124 views
  • 0 likes
  • 4 in conversation