How to make a loop between the variable date2 and date1 to check if there is a difference of more than 20 months between any of the combinations.

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input str9 id float(date1 date2)
"10019723" 17108 17015
"10019723" 17213 21587
"10019723" 17406     .
"10019723" 17749     .
"10019723" 18115     .
"10026239" 14083     .
"10026239" 14168     .
"10026239" 14259     .
"10026239" 14532     .
"10026239" 15484     .
"10027065" 13341     .
"10027065" 13437     .
"10027065" 13544     .
"10027065" 13629     .
"10027065" 13801     .
"10027065" 13992     .
"10027065" 14361     .
"10054335" 13621 20746
"10054335" 13699 21517
"10054335" 13816 21977
"10054335" 13915     .
"10054335" 15019     .
"10054335" 15747     .
"10054335" 21727     .
"10054335" 21798     .
"10054335" 21977     .
"10087618" 15917 14741
"10087618" 16002 15810
"10087618" 16195 16217
"10087618" 16377 16579
"10087618" 16579     .
"10087618" 17273     .
"10103855" 16932 16528
"10103855" 17209 16748
"10103855" 17552 17242
"10125009" 17065     .
"10125009" 17156     .
"10125009" 17329     .
"10171615" 21203 17455
"10171615" 21791 21367
"10171615" 22075 21755
"10181989" 13991     .
"10181989" 14089     .
"10181989" 14180     .
"10181989" 14264     .
"10181989" 14453     .
"10181989" 14628     .
"10187836" 14235     .
"10187836" 14319     .
"10187836" 14399     .
"10187836" 14490     .
"10187836" 14643     .
"10187836" 14900     .
"10187836" 15243     .
"10187836" 15670     .
"10223438" 14833     .
"10223438" 14893     .
"10223438" 14948     .
"10223438" 15008     .
"10223438" 15116     .
"10223438" 15172     .
"10223438" 15274     .
"102273"   16915     .
"10239623" 15939 15756
"10239623" 16020 15951
"10239623" 16163 16245
"10239623" 16261 17465
"10239623" 16478 17821
"10239623" 16688 19354
"10239623" 17090     .
"10239623" 17465     .
"10243938" 15369 15282
"10243938" 15460 15649
"10243938" 15538 21584
"10243938" 15792     .
"10243938" 15945     .
"10243938" 16727     .
"10260525" 17626     .
"10260525" 17934     .
"10260525" 18612     .
"10260525" 19011     .
"10281586" 14188     .
"10281586" 14356     .
"10282509" 14194     .
"10282509" 14292     .
"10287123" 14525     .
"10287123" 14692     .
"10287123" 14874     .
"10287123" 15047     .
"10287123" 15418     .
"10287123" 15519     .
"10298961" 13627     .
"10298961" 13830     .
"10318128" 14277     .
"10323354" 14006 18499
"10323354" 19855 21168
"10323354" 19963 21733
"10323354" 20157 21930
"10323354" 14098 18943
"10323354" 14189 19306
end
format %tdDD/NN/CCYY date1
format %tdDD/NN/CCYY date2
------------------ copy up to and including the previous line ------------------