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.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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