data _1;
input id subject $ marks;
datalines;
101 Physics 24
101 Chem 34
101 Maths 87
101 Biology 64
;
run;
data _2;
input id subject $ name $;
datalines;
101 Physics Maria
101 Chem John
101 Biology Jane
;
run;
proc sort data= _1;
by id subject;
run;
proc sort data= _2;
by id subject;
run;
data _3;
merge _1 _2;
by id subject;
run;
proc print data=_3 noobs;
run;
Result:
id subject marks name
101 Biology 64 Jane
101 Chem 34 John
101 Maths 87
101 Physics 24 Maria
Please take note of the proper methods for posting code, textual data and "listing" results, and the fact that missing character values are not displayed as dots.
... View more