@dharmesh
Just to show you how that would look like using SQL UNION CORR.
data class1 class2 class3;
set sashelp.class(where=(name='Alfred'));
output;
output;
name='Other';
output class2;
run;
proc sql;
create table want as
select * from class1
union corr
select * from class2
union corr
select * from class3
;
quit;
proc print data=want;
run;
This only works if you've got the same columns in all source tables AND if you really want to de-duplicate records which is different to just select the first record per sort key (where other variables within the same key still could have different values).
... View more