Derivation
variable: ageyear (table[s]: phdk_phdq, phdl_phdq)
variable: birth_date (table[s]: gen_identity_clean [derived table], genl_identity_clean [derived table])
variable: extdate (table[s]: phdk_fieldlog, phdl_fieldlog)
variable: intdate (table[s]: phdk_consent, phdl_consent)
variable: intdate (table[s]: phdk_phdq, phdl_phdq)
variable: dob (table[s]: NCD_combined_data_all_final [derived table])
egen date=rowmax(extdate intdate_cons intdate_phdq)
replace birth_date=b_dob if birth_date==. & b_dob~=.
gen age=int((date-birth_date)/365.25)
replace age=ageyear if age==. & ageyear~=.