SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Reading Hierarchical Files
Creating One Observation per Detail Record


Question:

What happens to the value of Address when the fifth record is read?

1---+----10---+----
H 321 S. MAIN ST 
P MARY E    21 F
P WILLIAM M 23 M 
P SUSAN K    3 F
H 324 S. MAIN ST

     data perm.people(drop=type);
        infile census;
        retain Address;
        input type $1. @;
        if type='H' then 
input @3 Address $15.;
if type='P'; input @3 Name $10. @13 Age 3.
@15 Gender $1.;
run;
321 S. MAIN ST is retained.
324 S. MAIN ST is read into the program data vector.


  back||next

 

Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement