Following is a response from DHS Research & Data Analysis Director, Tom Pullum:
This would be done with the PR file. The following lines use the "collapse" command to give you the sex distribution and the age distribution (in 5-year intervals). There is also a file that gives the age-sex distribution. You need to specify whether you want the de facto or de jure population. Even the collapsed files are large!
* You need to specify a workspace
cd e:\DHS\DHS_data\scratch
use hv005 hv102-hv105 shdistri using "C:\Users\26216\ICF\Analysis - Shared Resources\Data\DHSdata\IAPR74FL.DTA" , clear
gen wt=hv005/1000000
* If you want the de jure population
keep if hv102==1
* If, instead, you want the de facto population
* keep if hv103==1
* drop if age (hv105) is missing (.02 of 1% of cases). hv105 is 95 for age 95+
drop if hv105>95
* age5 gives standard age intervals for age 0-4, 5-9, etc
gen age5=1+ int(hv105/5)
collapse (sum) wt, by(hv104 age5 shdistri)
save IAtemp_age_sex_district.dta, replace
use IAtemp_age_sex_district.dta, clear
collapse (sum) wt, by(sex district)
* this file gives the weighted numbers of males and females in each district in the NFHS-4
save IAtemp_sex_district.dta, replace
use IAtemp_age_sex_district.dta, clear
collapse (sum) wt, by(age district)
* this file gives the weighted numbers of males and females in each five-year age group in the NFHS-4
save IAtemp_age_district.dta, replace