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.
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!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.