In reply to Leonid Batkhan.

Hello. This is potentially very useful, and I vote to add UNDUPC as a SAS native function.

I played around with this, and I think I found a small change that saves about 10% processing time. That is, use TRIM(x) instead of x in the TRANWRD function call. I obtained 9.3% to 9.9% improvement when I used it in a DATA _NULL_ step in order to isolate its contribution from the overhead of writing a new dataset. I would be glad to send a copy of the test, but I don't see a way to attach a document to this comment.

I suppose when implemented as a native function, it would be more efficient than the user-defined version in any case.