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. @16 Gender$1.;
run;
对于type='H'的某个记录,原文指出当遇到第二个if时,由于不满足条件,原话是Because the condition is not true, the remainingstatements are not executed and control returns to the top of the DATA step.The PDV is initialized but Address is retained.
为什么不是直接将PDV中的数据输出即执行呀?而是回到顶部重新读取了呢?
而当遇到type='P'即第二个条件满足后,原文说:Now the subsetting IF statement checksfor the condition type='P'. In this iteration, the condition is true, so thefinal INPUT statement reads the values for Name, Age, and Gender.Then the values in the program data vector are written as the first observation, and control returns to the top of the DATA step.
这个时候为什么说就可以将PDV中的数据作为第一个观测输出呢?