* CODE: Categorize Age - V1 * AUTHOR: Blink 7 (http://www.blink7.com) * DATE: February 26, 2008 * REQUIREMENTS: * DESCRIPTION: Categorizing a variable using SQL * NOTES: Make sure the file nameage.sas7bdat is in your WORK directory * before running this exercise ; DATA catv1; SET nameage; FORMAT age_category $16.; IF 10 <= age <= 19 THEN age_category = '10-19'; ELSE IF 20 <= age <= 29 THEN age_category = '20-29'; ELSE IF 30 <= age <= 39 THEN age_category = '30-39'; ELSE IF age >= 40 THEN age_category = '40+'; RUN; PROC PRINT DATA=catv1; RUN;