The DHS Program User Forum - RDF feed https://userforum.dhsprogram.com/index.php Nepal 2016 DHS and CDC values https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=14640&th=6977#msg_14640
For this survey, what is v008a actually measuring? I assume it is 'number of days since _____'. Can someone please fill in the blank, or straighten me out on this?

Thanks!]]>
Chris_Leary 2018-04-25T16:28:05-00:00
Re: Nepal 2016 DHS and CDC values https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=15639&th=6977#msg_15639 This is what is in the DHS6 Recode (Standard Recode Manual) page 5.

Century Month Code
All dates in the data file are expressed in terms of months and years and also as century month codes. A
century month code (CMC) is the number of the month since the start of the century. For example, January
1900 is CMC 1, January 1901 is CMC 13, January 1980 is CMC 961, and September 1994 is CMC 1137.
The CMC for a date is calculated from the month and year as follows:
CMC = (YY * 12) + MM for month MM in year 19YY.
To calculate the month and year from the CMC use the following formulae:
YY = int((CMC - 1) / 12)
MM = CMC - (YY * 12)
For Dates in 2000 and after the CMC is calculated as follows:
CMC = ((YYYY-1900) * 12) + MM for month MM in year YYYY.
To calculate the month and year from the CMC use the following formulae:
YYYY = int((CMC - 1) / 12)+1900
MM = CMC - ((YYYY-1900) * 12)

____________________________________________________________

We also now have CDC
Quote:

Century Day Code (CDC)
In DHS‐7, the DHS program introduced a new concept the Century Day Code (CDC). The CDC is
analogous to the century month code and gives the number of days since the beginning of 1900. The CDC for
a date of birth is computed in a similar manner to the CMC, using the reported day, month and year of birth.
Note that for simplicity in the calculation of the CDC the assumption is that 1900 is a leap year, but this is
also how Excel handles it. This does not affect any calculations of age, as all calculations are using a
consistent base.
The formulae to calculate the CDC of a date is an iterative process calculated in 2 steps:
Step 1: calculating the number of days since 1900 to the yyyy-1.
The formula to calculate the CDC is not as straight forward as the formulae to calculate the CMC
because the number of months per year is a fixed number (12 months). In the case of the CDC, the
calculation process for step 1 must be done with an iterative function because the number of days per
year varies depending if it's a leap year (366 days) or if it's regular year (365 days).
```Date = [dd]/[mm]/[yyyy]
CumulativeDays1 = 0
do i = 1900 while i < [yyyy]
CumulativeDays1 = CumulativeDays1 + 365 + (LeapYear = false);
enddo;
```
Note: the statement (LeapYear = false) will return value of 0 or 1
Step 2: calculating the number of days from yyyy to mm/dd
An interactive function should be used in this process because the number of days per months also
varies. There are months with 30 and 31 days, besides February can have 28 or 29 days depending if
it's a leap year or not.
```Date = [dd]/[mm]/[yyyy]
CumulativeDays2 = 0
xdays = 0 (working variable)
do i = 1 while i < [mm]
if mm in 1,3,5 xdays = 31 endif; (January, March, May)
if mm in 2 xdays = 28 + (LeapYear = false) endif; (February)
If mm in 4,6 xdays = 30 endif; ( April, June)
CumulativeDays2 = CumulativeDays2 + xdays;
enddo;
```
Note: the statement (LeapYear = false) will return value of 0 or 1
CDC = CumulativeDays1 + CumulativeDays2 + [dd]
]]>
Liz-DHS 2018-08-27T15:48:35-00:00
Re: Nepal 2016 DHS and CDC values https://userforum.dhsprogram.com/index.phpindex.php?t=rview&goto=16630&th=6977#msg_16630 Trevor-DHS 2019-02-07T23:30:50-00:00