SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Reading Hierarchical Files
Creating One Observation per Header Record


Question: Complete the ELSE clause with an IF-THEN statement so that, when the value of type is P, Total is incremented by 1.

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
          input type $1. @;
          if type ='H' then do;
             if _n_ > 1 then output;
             Total=0;
             input Address $ 3-17;
          end;
          else 


           

  back||next

 

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

Terms of Use & Legal Information | Privacy Statement