O'Reilly logo

Combining and Modifying SAS® Data Sets: Examples Second Edition by Michele M. Burlew

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Example 9.13 Calculating a Person's Age

Goal

Determine a person's age by using his or her date of birth.

Example Features

Featured StepDATA step
Featured Step Options and StatementsFLOOR and INTCK functions
A Closer LookMore about Calculating Ages and Anniversaries

Input Data Set

Data set MARCH_HIRES has the names and dates of birth for 10 employees hired on March 1, 2009. Variable DOB is a SAS date value. It is displayed with the WORDDATE20. format.

                 MARCH_HIRES

Obs    name                               dob 1 JK Allen March 1, 1972 2 RT Brown February 28, 1980 3 WI Carter March 29, 1980 4 LG Johnson March 1, 1980 5 MH Johnson December 12, 1980 6 PO Phillips February 14, 1971 7 TR Smith November 9, 1967 8 AG Rodriguez July 2, 1955 9 EW Washington July 30, 1960 10 NA Young ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required