Jan 25, 2011 #1 sap1958 Technical User Oct 22, 2009 138 US data table2; set table1; Age = Birthdate-TODAY(); format TotalSalary dollar12.2; run; When I run this I get a large number for the Age. ie 209501348 I should only get a 2 digit number
data table2; set table1; Age = Birthdate-TODAY(); format TotalSalary dollar12.2; run; When I run this I get a large number for the Age. ie 209501348 I should only get a 2 digit number
Jan 26, 2011 #2 jj72uk Programmer Dec 30, 2010 41 GB Have a go at this data table2; set table1; tday = date(); age = floor((intck('month',Birthdate,tday)- (day(tday) < day(Birthdate))) / 12); Where Birthdate is the date you want to see there age from. Upvote 0 Downvote
Have a go at this data table2; set table1; tday = date(); age = floor((intck('month',Birthdate,tday)- (day(tday) < day(Birthdate))) / 12); Where Birthdate is the date you want to see there age from.
Jan 31, 2011 #3 klaz2002 Programmer Nov 6, 2002 559 US Why cant you do it with just using the INTCK function without all the rules? ex. age = intck('year',Birthdate,date()); Upvote 0 Downvote
Why cant you do it with just using the INTCK function without all the rules? ex. age = intck('year',Birthdate,date());