data temp;
length name $20.;
length present $15.;
Present="Y";
do visit=1,2,3,4,8,10,15;
name='Namea';
output;
end;
do visit=2,15;
name='Nameb';
output;
end;
do visit=1,2,5,7,10,11,12,13,14,15;
name='Namec';
output;
end;
do visit=1,2,10,11,14,15;
name='Named';
output;
end;
do visit=1 to 15;
name='Namee';
output;
end;
run;
proc sort data=temp out=temps nodupkey;
by name;
run;
data dummy;
set temps(keep=name);
do lesson=1 to 18;
output;
end;
run;
proc sort data=dummy out=dummys nodup;
by name;
run;
data merged;
merge temps(in=a) dummys(in=b);
by name;
if a=b then present="Y";
else present="N";
run; Hello. My task is this: "The internship consists of 18 lessons. Create new variable named "present" and set to “Y” if student was present in that lesson or set to “N” if student was absent. " I tried this code but it didn't work,can you help to correct it?
... View more