Processing a DATA Step That Creates One Observation per Header Record
-
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.
-
As the execution begins, _N_ is 1 and Last is 0. Total is 0 because of the sum statement.
-
The value for Type is read, the condition type='H' is true, and therefore the statements in the DO group execute.
-
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.