Hello Kurt, Thank you for the answer. The first time I run the codes it doesn't inverse the cniv's variables. I try it again and it seems to work. I am going to add some missing values on my real table "have" to confirm if it work really ! I come back after to put as solution, thank you for you time, really appreciate your help (and of everyone) EDIT : @Kurt_Bremser If you have the time, could you explain the programm you made ? Because I don't understand very well what is done (well, i know that it do what i want but i don't understand every step).. More preciselly I don't understand this : data want;
set trans;
by group;
retain i flag;
if first.group
then do;
i = 0;
flag = 0;
end;
if col1 ne . then flag = 1;
if flag;
i + 1;
_name_ = cats(substr(_name_,1,4),i);
drop i;
run;
proc transpose data=want out=want_wide1 (drop=_name_);
by group;
var col1;
id _name_;
run;
data want_wide;
if _n_ = 0 then set cim_hierarchie; /* this restores all columns, including cniv8 */
merge
have1 (drop=cniv1-cniv8)
want_wide1
;
by group;
drop group;
run; Thank you again ! Onizuka
... View more