The problem could be solved by using data-step merge without by ... why don't you want to use merge?
proc sort data=a out=a_sorted(keep=Age) nodupkey;
by Age;
run;
proc sort data=b out=b_sorted(keep=Age) nodupkey;
by Age;
run;
proc sort data=c out=c_sorted(keep=Age) nodupkey;
by Age;
run;
data compare;
merge
a_sorted(rename=(Age = Age_A))
b_sorted(rename=(Age = Age_B))
c_sorted(rename=(Age = Age_C))
;
run;
Would the desired result be a list of distinct values per data set or the list of distinct values over all data sets?
The problem could be solved by using data-step merge without by ... why don't you want to use merge?
proc sort data=a out=a_sorted(keep=Age) nodupkey;
by Age;
run;
proc sort data=b out=b_sorted(keep=Age) nodupkey;
by Age;
run;
proc sort data=c out=c_sorted(keep=Age) nodupkey;
by Age;
run;
data compare;
merge
a_sorted(rename=(Age = Age_A))
b_sorted(rename=(Age = Age_B))
c_sorted(rename=(Age = Age_C))
;
run;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.