Hi STATALIST,

Could you please advice me how I can produce var3 from var2:
var1 is group IDs.

Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input float var1 str1 var2 str9 var3
1 "a" "a,b,c"    
1 "b" "a,b,c"    
1 "c" "a,b,c"    
2 "d" "d,e,f,g,h"
2 "f" "d,e,f,g,h"
2 "g" "d,e,f,g,h"
2 "h" "d,e,f,g,h"
end
Regards,