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 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.
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.
Got it.
Thanks! I thought "Set" is so good to use.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Get started using SAS Studio to write, run and debug your SAS programs.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.