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;
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.
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.