libname sasdata2 "e:\sasdata2"; data sasdata2.tecumseh_long; set sasdata2.tecumseh; keep id sex age marital height weight round; if age1 not=. then do; age = age1; marital = marital1; height = htcm1; weight = wtkg1; round = 1; output; end; if age2 not=. then do; age = age2; marital = marital2; height = htcm2; weight = wtkg2; round = 2; output; end; if age3 not=. then do; age = age3; marital = marital3; height = htcm3; weight = wtkg3; round = 3; output; end; run; proc print data=sasdata2.tecumseh_long(obs=25); run; proc means data=sasdata2.tecumseh_long; class round; run;