Thank you, Ksharp . The program below works as what I expect. data temp; set have; array x{*} $ code:; x1=scan(catx('|',of x{*}),1,'|'); x2=scan(catx('|',of x{*}),2,'|'); run; However, the last program run into problem. The proc summary run into problem. proc summary data=temp; by id ; output out=want idgroup(out[&n] (ticket date1 date2 x1 x2)=); run; proc print noobs;run; Here is what it displays: "The parameter value 17641 is not within the required range of 1 and 100". I work around by creating 3 data steps and merge them back at the end. It works fine but I am looking for a better way to do. Thanks for your input.
... View more