Hello, I'm a SAS beginner and I have the following situation: data a;
student=1; age=27; output;
student=2; age=22; output;
student=3; age=25; output;
run;
data b;
student=4; agegrp=20; output;
student=5; agegrp=40; output;
student=6; agegrp=30; output;
student=7; agegrp=50; output;
run;
data c;
teacher=9;
run;
/******* data set creation *******/
data all1;
if _n_=1 then set c;
set a b;
if age NE . then agegrp=age;
run;
data all2;
if _n_=1 then set c;
set a b ;
if agegrp =. then agegrp=age;
run; I want to append the values in the column "age" to the ones in column "agegrp", but I'm having different results depending on which if-statement I choose. Could anyone please explain me the difference in interpretation from SAS that makes it to repeat the number "27" (age from student 1) in the first 3 rows of agegrp in "all2" and to not do it for the first data set (all1), doing it correctly? Thank you!!
... View more