BookmarkSubscribeRSS Feed
Lemond2022
Calcite | Level 5

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?

2 REPLIES 2
SASKiwi
PROC Star

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;
Kurt_Bremser
Super User

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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1025 views
  • 0 likes
  • 3 in conversation