id DOB year
1 901020 2014
2 981020 2014
3 841028 2014
4 790707 2014
5 800301 2014
6 900103 2014
7 990328 2014
8 780812 2014
9 890302 2014
10 900101 2014
11 901020 2015
12 981020 2015
13 901020 2015
14 770707 2015
15 981020 2015
16 981020 2015
17 990328 2015
18 740403 2015
19 730203 2015
20 980202 2015
DOB; date of birth, year;the year of the survey

I want to check cases that having same DOB between two different year group.
What kind of code can I use?