Hello Vvalentin_HU,
This is a solution:
[pre]
data i;
input Text $ group;
datalines;
text1 1
text2 1
text3 1
text4 1
text1 2
text2 2
text1 3
text2 3
text3 3
run;
data r;
retain t;
length t $100;
set i;
if First.group then t="";
t=CATX('_',t,text);
if Last.group then output;
by group;
keep t group;
run;
[/pre]
Sincerely,
SPR