You have to do this twice. Once for women and then once for men. Here is how to merge the AR file with the CR file for women first:
* Step 1: open AR file
use "xxAR61FL.DTA", clear
* Step 2: rename identifying variables
renvars hivclust hivnumb hivline / v001 v002 v003
* Step 3: sort by identifying variables
sort v001 v002 v003
* Step 4: save results
save "xxAR61FL_mergeprep.DTA", replace
* Step 5: open IR file
use "xxCR61FL.DTA", clear
* Step 6: sort by identifying variables
sort v001 v002 v003
* Step 7: merge!
merge v001 v002 v003 using "xxAR61FL_mergeprep.DTA"
* Step 8: Keep only women
drop if _merge==2
Then rename the added hiv variables to something unique for women, e.g.
and repeat steps 1-8 above using mv003 instead of v003 throughout to merge the men's hiv test result and then finally rename the hiv variables to be for men, e.g.