Trouble accessing external files using INFILE statement on MAC

Reply
N/A
Posts: 1

Trouble accessing external files using INFILE statement on MAC

Hello,

I'm currently trying to access an external file .dat file on my MAC using INFILE, and it keeps coming up as the 'physical file does not exist'. Below is my syntax. I've put it in my Users folder, my desktop, documents, etc.  I've tried two ways:

infile '\\client\c$\pilot.dat';

and

infile '//users/bebe/pilot.dat';

I'm not sure what the correct syntax path is. Having a lot of trouble trying to do this without using datalines. I've also tried csv files as well that definitely didn't work.

Esteemed Advisor
Posts: 6,636

Re: Trouble accessing external files using INFILE statement on MAC

First thing: Underneath the hood of your Mac works a genuine UNIX system, so forget to use the backslash as anything else than a VERY special character.

UNIX's have no drive designators, just one filesystem starting at root; everything is mounted somewhere in there.

Your path to the file should start with a single slash (aka root), and directories need to be separated with slashes. Everything is case sensitive, so if your file is stored as Pilot.dat, pilot.dat won't find it.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Learner
Posts: 1

Re: Trouble accessing external files using INFILE statement on MAC

180
 
ERROR 180-322: Statement is not valid or it is used out of proper order.
 
57 infile '/Users/Nani/Documents/SASUniversityEdition/Myfolders/Workbook1.txt';
______
180
 
ERROR 180-322: Statement is not valid or it is used out of proper order.
 
58 input name $ Check $ age;
_____
180
 
ERROR 180-322: Statement is not valid or it is used out of proper order.
 
59 run;
60
61 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
73
Esteemed Advisor
Posts: 5,194

Re: Trouble accessing external files using INFILE statement on MAC

Excuse me @naniraki, but what are you doing?
This thread is 1.5 years old.
If you have an issue, create a new topic and describe in words what you are trying to do and what you are expecting, with a FULL log.
Data never sleeps
Ask a Question
Discussion stats
  • 3 replies
  • 559 views
  • 0 likes
  • 4 in conversation