Dear All,
Can some one help me with below query. I have 1st dataset with three variables.
Id, date, term
I have second dataset with below three variables.
Term1,date1,id
For both the dataset ID is the primary key variable. I would like to write a query to output when TERM is not equal to TERM1. Term and Term1 will not be same sorting order for one to one match.
The output should look like this.
12004002 TRAMADOL UN/AUG/2014
12004002 MICONAZOL 18/JAN/2016
Thanks
Rakesh
Which variables are in the output? Term, Term1, Date or date1 (assuming that ID is one of the output variables).
What about dates? Do those have to match or be within a window of each other?
This may give what your are looking for if I understand the problem:
proc sql;
create table want as
select table1.id, table1.term,table1.date, table2.term1
from table1 left join table2
on table1.id=table2.id
where table1.term ne table2.term1;
quit;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.