Reading Hierarchical Files |
Creating One Observation per Header Record |
As you write the DATA step to read this file, you need to think about
performing several tasks. First, the value of Address must be
retained as detail records are read and summarized. |
data perm.people; infile census; retain Address; |
|
Next, the value of type must be read to determine if the
current record is a header or a detail record. Add an @ to hold the record
for another INPUT statement to read the remaining values. |
data perm.people; infile census; retain Address; input type $1. @; |
|
When the value of type indicates a header record, several
statements need to be executed. When the value of type indicates
a detail record, you need to define an alternative set of actions. Let's
take a look at executing different sets of statements for each value of
type . |
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.