This is the simplest possible question.
I have a file named "population.sas7bdat" at C:\project
How can I read this file on SAS 9.4?
A sas7bdat file is what is called a SAS dataset. The most direct way of reading this into a temporary dataset is like this:
data Want; * Reads the dataset into a temporary dataset called Want.;
set 'c:\UK\population.sas7bdat';
run;
* Prints the first 10 rows in the dataset;
proc print data = 'c:\UK\population.sas7bdat' (obs = 10);
run;
Or you go the library way:
libname in "c:\project";
data want;
set in.population;
run;
This assumes that your SAS is in fact installed and running on your desktop. If you use SAS on a server with SAS Studio or Enterprise Guide, you have to upload the file to the server first.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.