I am trying to understand what this program does.
data a;
set b (keep=c d);
by c;
if first.c then e=0;
e+d;
if last.c;
run;
What confuses me is the following.
1), When there is not THEN statements, what does and IF statement do?
2), When there is no value evalueated, what does an IF statement do ? (why would it not say something like if first.c =1 ?)
3), My understanding is that e is an accumulator variable starting from 0, and d is added by iteration. But for some reason e represents the total for all values of c, not d even though we are adding d.
I am thinking that the first two questions will answer my question 3, but I would really appreciate your help.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…