There are many active programmers in this community, I thank everyone of them for their time and effort! As usual, more than one solution exists. RichardinOz's solution I can verify is working. RDW9's has a problem with the first code he's reading, but I sure that could be fixed. Tom's comment on checking the existence of the generated code's I will surely take to heart. But I'm really impressed with Haikuo's compact and elegant use of the SAS functions COMPRESS, CATS and CATX. He also circumvents the typo problem noted by Data _null_ A big thank you all!
... View more