by Brad Phillips
Date fields in SPSS are a pain, but if your data is in the correct format, here is a nice little trick.
Line 1 compute age=rnd(ctime.days(date.mdy(06,01,92)-bday)/365.25).
Line 2 recode age (0 thru 19=1) (20 thru 24=2) (25 thru 29=3) (30 thru 49=4) (50 thru 99=5).
Line 3 value labels /age 1 'Under 20' 2 '20 - 24' 3 '25 - 29' 4 '30 - 49' 5 '50+'.
Line 1 computes a new variable called age from a SPSS command using a date conversion and a semester start date of 6/1/92 (summer school) subtracted from the variable bday (student birth date) and then divides by the number of days in a year.
Line 2 simply recodes age into MIS ranges, but this is not necessary if you want to get a range of ages.
Line 3 add value labels to the numeric codes.