Date Variables

Date type responses write out multiple variables to the final data file, depending upon what components were collected: Full Date or Year and Month only. QDS date values in the data file are equal to the number of days since December 30, 1899 (dates before December 30, 1899 have negative values). For example, a date of 12/30/1899 = 0 and 12/31/1899 = 1.

Tip: The component variablesClosedA component variable is one part of a composite variable. Check Each, ranking, date, time, and time span response types all have composite and component variables. A Check Each component represents whether or not a response was selected. A ranking component represents the rank selected. A date, time, or time span component represents that part of the whole date or time, such as year, month, weeks, hour or minute. (month, day, and year parts) will always appear at the end of a QDS dataset variable listing rather than being listed with their corresponding composite variable.

Full Dates

When the components option on the Response Set tab is set to collect a full date (month, day, year), the full value is written out to a variable with the variable name from the Data Element tab. Separate month, day, and year variables are written out with the values entered for each selected component.

For example, for a full date response of 7/14/1985 named DOB, the following variables would be written to the data file:

  • DOB=7/14/1985
  • DOBM=7
  • DOBD=14
  • DOBY=1985

Partial Dates

When the components option on the Response Set tab is set to collect “Year and Month Only”, a partial value is written out to a variable with the Data Element tab Variable Name. Year and month component variables are also written out.

For a Month/Year partial date response of 7/1985 named DOB, the following variables would be written to the data file:

  • DOB=7/??/1985
  • DOBM=7
  • DOBY=1985

The “full” date is displayed in the Warehouse Manager as 7/??/1985. As long as month is not missing, the date is exported in Month-Year format to SAS XML, SPSS, and Stata (the full date will be missing in SAS Transport). The component variables can be used to construct a new full date in your data analysis software package. If “Year Only” is collected, there will be a single numeric variable for the year.

Allowing Month or Day Missing

If the option for “Allow Missing Day” (Full Date or Year/Month) or “Allow Missing Month” (Full Date) is enabled on the Response Set tab, then a full date is collected where the substituted value is used for any missing data.

Tip:The RTF Codebook indicates if a missing component ClosedA component variable is one part of a composite variable. Check Each, ranking, date, time, and time span response types all have composite and component variables. A Check Each component represents whether or not a response was selected. A ranking component represents the rank selected. A date, time, or time span component represents that part of the whole date or time, such as year, month, weeks, hour or minute.is allowed following the range; the CSV codebook indicates this in the Notes column.

In the image below, a “15” is used for a missing day and a “6” is used for a missing month. A valid day between 1 and 31 for “day” or 1 to 12 for “month” must be entered in the Day/Month box.

Date type response: Allowing Month or Day Missing options

For a full date response where the day was missing, the following variables would be written to the data file:

  • DOB=7/??/1985
  • DOBM=7
  • DOBD=15
  • DOBY=1985

The full date shows the missing day, but the substituted value of “15” is written out to the day component. This missing value is not used when performing calculations within QDS (the numeric range is used) but could be used to form a full date value in SAS, Stata, or SPSS from the components.