Dates
Recall that there are only two types of variables: numeric and character.
Dates are stored as a numeric value.
The informat tells SAS how to read the raw character values "012366".
What is stored is the number of days since January 1, 1960.
For example:
DATA POINTER;
INPUT @1 ID 3.
@13 CharDOB $6.
@13 DOB MMDDYY6.;
DATALINES;
101 M 26 68 012366
102 M 32 78 031460
103 F 45 62 112647
104 F 22 66 080170
;
PROC PRINT DATA=POINTER;
TITLE 'Example 6, modified';
RUN;
Note that the same data was read more than once (for another example of this, see example 8 in chapter 1).
The code produces the following output:
Example 6, modified OBS ID CHARDOB DOB 1 101 012366 2214 2 102 031460 73 3 103 112647 -4419 4 104 080170 3865
Important Notes:
Dates are stored as the number of days since 1960.
To make the internal numeric value print correctly, use the FORMAT statement.