Read sample input of 5 rows & 3 columns (name , Gender, Age) using data lines into a temporary SAS dataset, and create new column Age-group with values ( >45, 18-44, 0-5,5-11,11-18 ) while reading the datalines into SAS datasets. Based on age column, Create a new column Age group Based a=on age value derive age group below is example for Age value and corresponding age group value. Age Agegroup 5 0-5 65 >45 90 >45 30 18-44 SOLUTION: data task; input name $ gender $ age; datalines; Reena F 25 Shyam M 40 Deva M 53 John M 63 Mery F 9 ; a=age; if 0<a<=5 then agegroup=0-5; if 5<a<=11 then agegroup=5-11; if 11<a<=18 then agegroup =11-18; if 18<a<=44 then agegroup=18-44; if a>45 then agegroup=>45; run; I have tried in this way but its not coming. please help me out......
... View more