/* Uses user supplied data , yearlist.raw, that has one line for each pair of years to be matched. The entries on each line are: the final two digits of the first year of the match (e.g. 83) forrowed by zero to three numbers. These numbers are the month-pairs to be matched. If none is specified, it is assumed that all months are to be matched. Example: 83 1 2 87 If yearlist.raw included the above entries, the request would be to match first the 83 & 84 files, mis 1 in 83 to mis 5 in 84 and mis 2 in 83 to mis 6 in 84. Next the entire 87 & 88 files are to be matched. Notice that <87> is equilivent to <87 1 2 3 4> or, for that matter, to <87 4 3 1 2> etc. */ drop _all infile using yearlist.cps drop if year1==. mac def Nmatches=_N prog def yearmacs local i 1 while `i'<=$Nmatches { mac def yr1`i'=year1[`i'] mac def mo1`i'=month1[`i'] mac def mo2`i'=month2[`i'] mac def mo3`i'=month3[`i'] mac def mo4`i'=month4[`i'] if ${mo1`i'}==. { mac def mo1`i' 1 mac def mo2`i' 2 mac def mo3`i' 3 mac def mo4`i' 4 } local i=`i'+1 } end yearmacs prog drop yearmacs exit 0