Write and run SAS programs in your web browser

How to use dirdata in SAS Studio

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 112
Accepted Solution

How to use dirdata in SAS Studio

Hello everyone,

 

I uploaded the .dat file "Boats" to myfolders,

and used &"dirdata" command.

but I got error message.

Is anyone can help me take a look at what I had done wrong?

Thanks!

 

The code I put in SAS Studio is as below:

%let dirdata='/folders/myfolders';

data boats;
set '&dirdata/Programs/Week_3/Boats.dat';
run;

proc print data=boats;
run;

The LOG is :

 

 
 
 1          OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 72         
 73         %let dirdata='/folders/myfolders';
 74         
 75         data boats;
 76         set '&dirdata/Programs/Week_3/Boats.dat';
 ERROR: Extension for physical file name "&dirdata/Programs/Week_3/Boats.dat" does not correspond to a valid member type.
 77         run;
 
 NOTE: The SAS System stopped processing this step because of errors.
 WARNING: The data set WORK.BOATS may be incomplete.  When this step was stopped there were 0 observations and 0 variables.
 WARNING: Data set WORK.BOATS was not replaced because this step was stopped.
 NOTE: DATA statement used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 78         
 79         proc print data=boats;
 80         run;
 
 NOTE: No variables in data set WORK.BOATS.
 NOTE: PROCEDURE PRINT used (Total process time):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 81         
 82         
 83         
 84         OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
 97         

Accepted Solutions
Solution
‎03-05-2018 08:55 PM
Valued Guide
Posts: 592

Re: How to use dirdata in SAS Studio

You can only read SAS data files with the SET statement - the .dat extension is not tied to any particular application so you'll need to find out what format it is in before attempting to read it into SAS.

View solution in original post


All Replies
Solution
‎03-05-2018 08:55 PM
Valued Guide
Posts: 592

Re: How to use dirdata in SAS Studio

You can only read SAS data files with the SET statement - the .dat extension is not tied to any particular application so you'll need to find out what format it is in before attempting to read it into SAS.

Highlighted
Frequent Contributor
Posts: 112

Re: How to use dirdata in SAS Studio

Posted in reply to ChrisBrooks

Got it.

 

Thanks! I thought "Set" is so good to use.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 134 views
  • 1 like
  • 2 in conversation