September 2019
Beginner to intermediate
346 pages
7h 35m
English
SAS stores all dates as single unique numbers in a numeric format. All dates are stored as the number of dates from January 1, 1960. If you think of a number line, all dates prior to January 1, 1960 are negative and all dates after that are positive. It’s cumbersome to decode the numeric dates. An easier alternative is to get SAS to display a date using a date format. Let's look at our cost of living dataset with the addition of a new date variable:
DATA COST_LIVING;INPUT City $12. Index Prev_yr_index Housing Food Travel Utility Education Leisure Other Updated MMDDYY6.;DATALINES;Adelaide 85 83 35 10 10 9 14 10 12 010118Beijing 90 92 40 10 15 10 18 5 2 010118Copenhagen 65 64 25 15 10 10 12 12 16 020118 ...
Read now
Unlock full access