Following is a response from DHS Research & Data Analysis Director, Tom Pullum:
The following lines will do what you want. You can run this on any IR file. I assign code "0" to women who have not had a first birth but of course that's optional.
use "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\ALIR71FL.DTA" , clear
rename b*_0* b*_*
gen sex_of_first_child=.
local li=1
while `li'<=20 {
replace sex_of_first_child=b4_`li' if bord_`li'==1
local li=`li'+1
}
replace sex_of_first_child=0 if sex_of_first_child==.
label define first_child 0 "No children" 1 "Boy" 2 "Girl"
label values sex_of_first_child first_child
tab sex_of_first_child