In reply to Aad van Strien.

Thank you, Aad, for your comment. I am glad that initial failure did not stop you and you still managed to solve this challenge. Indeed, this macro heavily relies on ASCII codes, and I erroneously assumed that no one uses IBM mainframes and AS/400s anymore. The optimal solution is to stop using them immediately. Of course, I could have augmented the macro with a logic accounting for whether SAS runs on ASCII or EBCDIC (e.g. byte(78)='N' for ASCII, byte(78)='+' for EBCDIC), but that would have been too backward-looking solution...