In reply to Ksharp. Thank you, Ksharp, for your constructive comment. Indeed, Perl regular expressions are very powerful and can be used in SAS via prxchange() function. However, I found it to be considerably less efficient than using SAS string manipulation functions. For example, I ran the following code, and it turned out that the transtrn(STR,'
',trimn('')) approach ran more than twice as fast as prxchange('s/<.+?>//',-1,str) :

/* 25 sec */
data LONG;
set HAVE;
do i=1 to 10000000;
output;
end;
run;

/* 3:51 min = 231 sec */
data WANT;
set LONG;
want=prxchange('s/<.+?>//',-1,str);
run;

/* 1:48 min = 108 sec */
data WANT1;
set LONG;
want=transtrn(STR,'
',trimn(''));
run;

Could you run this (or similar) test on your machine to see if your results are consistent with mine?