BookmarkSubscribeRSS Feed
rawindar
Calcite | Level 5

Hi all,

       I just want to know can we get non matching observations using joins.

Thanks&Regards

rawindarreddy

3 REPLIES 3
Ksharp
Super User

Do your mean SQL's join ?

Yes. you can do it .But I would like to use IN operator to get it.

The following pick up the records which is in b, not in a .

data a;
 set sashelp.class(keep=name obs=10);
 retain _dummy 10;
run;
data b;
 set sashelp.class;
run;
proc sql;
create table not_matched as
 select b.* 
  from b left join a on b.name eq a.name
   where a.name is missing ;quit;


Ksharp

Jagadishkatam
Amethyst | Level 16

Yes Rawinder, We can sure get non matching onservation from joins.

Please check the example.

data one;

input id suspect;

cards;

2 3

6 3

2 4

5 4

9 8

;

run;

data two;

input id suspect;

cards;

5 1

3 1

2 4

5 4

9 8

;

run;

proc sql;

select * from one full join two on one.id=two.id where one.id ne two.id;

quit;

Thanks,
Jag
shivas
Pyrite | Level 9

Hi Ravi,

Check this...

https://communities.sas.com/message/122974#122974

Thanks,

Shiva

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

What is Bayesian Analysis?

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 808 views
  • 0 likes
  • 4 in conversation