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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.