DATA Step, Macro, Functions and more

how to write mac path in sas studio

Reply
Occasional Learner
Posts: 1

how to write mac path in sas studio

I wrote this code in sas under mac 

infile "/Users/mandychan/Desktop/student.txt" options; 

 

and there is error popping up in the log,

infile "/Users/mandychan/Desktop/student.txt" options;
______
180
 
ERROR 180-322: Statement is not valid or it is used out of proper order.
 
can anyone help to solve this question? is it the problem of the path
Super User
Posts: 9,691

Re: how to write mac path in sas studio

If you are using University Edition . Should look like :

 

infile '/folders/myfolders/test.txt';

 

Or use the following code to check how your paht should look like .

 

%let x=%sysfunc(pathname(work));
%put &x ;
Super User
Posts: 17,963

Re: how to write mac path in sas studio

1. Go back and read the installation instructions
2. Verify shared drive is set up (myfolders)
3. Move file to myfolders
4. Use path as follows '/folders/myfolders/student.txt';
Super User
Posts: 3,115

Re: how to write mac path in sas studio

You need to precede your INFILE statement with a DATA statement:

 

data mandy;

  infile .......;

 

Ask a Question
Discussion stats
  • 3 replies
  • 459 views
  • 0 likes
  • 4 in conversation