Try this. data precode;
infile datalines dlm="|";
input
student: $10.
schoolid: $3.
stateid: 8.;
datalines;
tom|005|1
bill|004|2
fred|005|3
;
run;
data SIS;
infile datalines dlm="|";
input
student: $10.
BEDS: $3.
student_number: 8.;
datalines;
tom|005|1
bill|004|2
fred|008|3
sam|016|4
;
run;
proc sql;
create table all as
select
coalescec(b.student,a.student) as student,
coalescec(b.beds,a.schoolid) as schoolid,
coalesce(b.student_number,a.stateid) as stateid
from precode a full join sis b
on a.stateid=b.student_number;
quit;
... View more