is there a way to remove from a data set the IDs (that are also replicated) not present in a second data set?
dataset1
ID Age00001 34-50
00001 34-50
00002 30-50
00002 30-50
00002 30-50
00005 25-34
00005 25-34
00006 45-50
.... ....
dataset2
ID Sex00001 F
00001 F
00002 F
00002 F
00002 F
00004 M
00004 M
00003 F
.... ....
Desired output
ID Sex00001 F
00001 F
00002 F
00002 F
00002 F
.... ....
I tried (without success):
> proc sql;
> select*from dataset1
> where ID in(select ID from dataset2),
> quit;