If the variables have different names (e.g. Zscore, Postzscore Prezscore) use the scan function to extract numbers for the score_group formula in table2
data table1 (drop=member);
input Score1 Score2 Score3 Member: $1.;
if trim(member) in ("Y");
id=_n_;
cards;
10 8 34 Y
12 5 12 N
15 18 10 Y
8 16 0 Y
15 12 5 Y
12 0 2 N
6 8 15 Y
10 13 21 Y
;
/* Transpose into one column */
proc transpose data=table1 out=long;
by id;
run;
data table2 (drop=_name_ id);
length score_group 4;
set long;
score_group=input(substr(_name_,6),1.);
rename col1=score;
run;
proc sort;
by score_group;
run;
... View more