Following is a response from DHS Research & Data Analysis Director, Tom Pullum:
The line number is the same for all these types of data. The following lines illustrate a PR / IR merge for the latest Rwanda survey. I put the PR file first and then the IR file but the reverse order will give the same result. Note that I need a place to save the sorted PR file. Besides the hdis and d variables I only keep the hv0* and v0* variables but you can keep whatever you want.
cd e:\DHS\DHS_data\scratch
use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\RWPR81FL.DTA" , clear
keep if hv117==1
keep hv0* hvidx hdis*
gen cluster=hv001
gen hh=hv002
gen line=hvidx
sort cluster hh line
save RWPRtemp.dta, replace
use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\RWIR81FL.DTA" , clear
keep v0* d*
gen cluster=v001
gen hh=v002
gen line=v003
sort cluster hh line
merge 1:1 cluster hh line using RWPRtemp.dta
keep if _merge==3
drop _merge