HI @Ronein Good catch and thank you pointing me lack of attention to detail as to have missed to include h.definedata("Team");
So, I have added that below in the modified one 🙂 Thanks again
Data Summary_tbl;
INFILE DATALINES DLM=',';
INPUT Team $ Model1 Model2 Model3 Model4 Model5;
cards;
b,10,18,14,16,4
d,8,24,16,20,6
e,6,18,12,15,8
c,1,7,3,14,2
a,2,1,10,14,1
Total,27,68,55,79,21
;
Run;
data _null_ ;
if _n_=1 then do;
set Summary_tbl(where=(Team='Total'));
array m(*) model:;
array t(5);
call pokelong(peekclong(addrlong(m(1)),40),addrlong(t1),40);
call sortn(of t(*));
dcl hash H (ordered:'a') ;
h.definekey("_n_");
h.definedata("Team");
do _n_=1 to dim(t);
_iorc_=whichn(t(_n_),of m(*));
h.definedata (vname(m(_iorc_))) ;
end;
h.definedone();
_n_=1;
end;
set Summary_tbl end=z;
h.replace();
if z;
h.output(dataset:'want');
run;
... View more