Please let me know how to calculate dependency ration in STATA.. is the command below correct

bys ScheduleNo: egen Age_Working = count(B2Q1) if Age>=15 & Age<=64
bys ScheduleNo: egen count_Age_Working= max(Age_Working)
recode count_Age_Working (.=0)
bys ScheduleNo: egen Age_Dep = count(B2Q1) if Age<=14 | Age>=65
bys ScheduleNo: egen count_Age_Dep= max(Age_Dep)
recode count_Age_Dep(.=0)
gen DRatio = (count_Age_Dep/count_Age_Working)*100
recode DRatio(.=0)