Here is another response from DHS Stata Expert, Tom Pullum:
The following Stata lines should accomplish what you want, with the births re-sequenced by birth order rather than by recency.
quietly summarize v201
scalar max_ceb=r(max)
keep v011 b3* bord*
rename b*_0* b*_*
* bord_1 is the birth order of the most recent birth
* the first birth will be the one for which bord_1=1 or bord_2=1 or bord3=1, etc
* the second birth will be the one for which bord_1=2 or bord_2=2 or bord3=2, etc
local lj=1
quietly while `lj'<=max_ceb {
gen b3ordered_`lj'=.
local li=1
while `li'<=max_ceb {
replace b3ordered_`lj'=b3_`li' if bord_`li'==`lj'
local li=`li'+1
}
local lj=`lj'+1
}
summarize b3_*
summarize b3ordered_*