I have two SAS datasets. First one is Sep_release and second one is Oct_release. Both the datasets have REFERENCE_NUMBER as common variables. I want to find if the REFERENCE_NUMBER released in sep_release is also coming in Oct_release. Basically trying to find the duplicate REFERENCE_NUMBER in both the datasets. But I am unsure of best way of doing it. I tried proc sort and data step but not getting the result as the code is not right and I am unsure of the right way to approach. Can you please suggest?
data duplicate_REFERENCE_NUMBER;
set sep_release oct_release;
if not (first.REFERENCE_NUMBER) then output;
run;
Also, I tried this step
Proc sort data=sep_release
nodupkey dupout=oct_release;
by REFERENCE_NUMBER;
run;
data a;
set sashelp.class;
run;
data b;
set sashelp.class;
if _n_=1 then delete;
run;
proc sql;
create table duplicate_name as
select name from a
intersect
select name from b
;
quit;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.
Find more tutorials on the SAS Users YouTube channel.