Hi Rich, I use pc sas (9.3). the _name_ values I generated are lowcase in the thave dataset. Below is what I got when I ran your code: data have; input program: col1 col2 col3; cards; 10 3 5 1 15 1 2 7 24 6 8 5 21 2 8 1 35 9 4 3 33 3 1 1 ; proc transpose data = have out=thave; var col1-col3; run; data test (drop=col:); set thave; select(_name_); when ('COL1') do; PrgA = sum(col1,col2); PrgB = sum(col3,col4); PrgC = sum(col5,col6); end; when ('COL2') do; PrgA = sum(col1,col2); PrgB = sum(col3,col4); PrgC = sum(col5,col6); end; when ('COL3') do; PrgA = sum(col1,col2); PrgB = sum(col3,col4); PrgC = sum(col5,col6); end; otherwise; end; run; proc print data=test;run; Obs _NAME_ PrgA PrgB PrgC 1 col1 . . . 2 col2 . . . 3 col3 . . . Thanks - Linlin
... View more