data banktest; infile "&sasforum.\datasets\banktest.txt" firstobs=2 dlm='09'x; input ID $ year Month $ value; run;
proc sort data=banktest; by year month id; run;
data banktemp; length newId $64; do until(last.month); set banktest; by year month id; if last.id then newId = catx("|", newId, Id); end; do until(last.month); set banktest; by year month; output; end; run;
proc transpose data=banktemp prefix=value_of_ out=bankWant(drop=_name_); by year month newId notsorted; id id;
var value; run;
proc print data=bankWant noobs; run;
PG
PG
Catch up on SAS Innovate 2026
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.