data one; input S_id S_i score; cards; 1 1 98 1 2 76 1 3 63 2 1 96 2 2 85 2 3 76 ; run; data score_one; set one; by S_id S_i; array ascore(3); retain ascore1-ascore3; /*if first.S_id then call missing(of ascore1-ascore3);*/ ascore(S_i)=score; /*output;*/ if last.S_id then output; keep S_id ascore1-ascore3; run; when I work on the reshaping through by statement, it seems the first.s_id does not take an effect when combining with the call missing routine. As shown above, when I comments if first.S_id call missing line, the codes can generate the same data set. Call missing should assign empty values for first-id =1, but we do have the values for the first line. I use "output" to display the loop. It is a bit confusing about the data assignment. What is the proper understanding?
... View more