O'Reilly logo

SAS Certification Prep Guide, 4th Edition by SAS Institute

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating One Observation per Header Record

The Basics of Creating One Observation per Header Record

This example uses the data set below to create a summary variable, Total.
Raw Data File
SAS Data Set
As you write the DATA step to read this file, think about performing several tasks. First, the value of Address must be retained as detail records are read and summarized.
data perm.residents; 
   infile census; 
   retain Address;
Using a RETAIN Statement
Next, the value of Type must be read in ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required