* SAS has powerful procedures for reshaping data, such as Proc TRANSPOSE. However, for a situation where multiple adjacent records all belong to the same subject, the following approach can be used to convert data in univarate format into multivariate format ; data prob3 ; length agegroup $ 12 ; input agegroup $ rep time consump1 / agegroup2 $ rep2 time2 consump2 / agegroup3 $ rep3 time3 consump3 / agegroup4 $ rep4 time4 consump4 / agegroup5 $ rep5 time5 consump5 ; keep agegroup rep consump1 consump2 consump3 consump4 consump5 ; cards ; adolescents 1 1 0.83 adolescents 1 2 0.79 adolescents 1 3 0.80 adolescents 1 4 0.78 adolescents 1 5 0.73 children 1 1 0.78 children 1 2 0.76 children 1 3 0.76 children 1 4 0.68 children 1 5 0.67 youngadults 1 1 0.81 youngadults 1 2 0.82 youngadults 1 3 0.78 youngadults 1 4 0.83 youngadults 1 5 0.85 ; proc print data = prob3 ; run ;