Processing a DATA Step That Creates One Observation per Header Record

  1. During the compilation phase, the variable type is flagged so that later it can be dropped. The value for Address and Total (sum statement) are retained.
    Compilation Phase
  2. As the execution begins, _N_ is 1 and Last is 0. Total is 0 because of the sum statement.
    Execution Phase
  3. The value for Type is read, the condition type='H' is true, and therefore the statements in the DO group execute.
  4. The condition N>1 is not true, so the OUTPUT statement is not executed. However, Total is assigned ...

Get SAS Certification Prep Guide, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.