data aaa; aa = 1; b = 3; output; run;
data ccc; aa = 2; output; aa = 3; output; aa = 3; output; aa = 3; output; aa = 4; output; aa = 5; output; run;
data aab; put _all_; set aaa ccc; /* by aa;*/ if aa = 3 then do; b = 1; b1 = 2; end; put _all_; run;
As above, when I comment the by statement, b is retained as 1 when aa = 4, 5. However when I uncomment the by statement, the value of b becomes missing. I wonder what happended when by xxx is used with set statement?
By the way, if the set statement is replaced by merge statement, no matter whether commenting the by statement or not, the value of b never become 1 when aa = 4,5
... View more