Your code as posted won't run anyway, because it misses a comma.
If you want a macro variable resolved in
'W&I' AS BU
you must use double quotes.
With 16 digits, you are in the area where numeric precision comes into play.
You concatenate a 16-digit string (result of PUT with $16.) and a 3-digit string (result of PUT with Z3.), and INPUT it with 16. That makes no sense to me. Even with the COMPRESS, once you have more than 13 digits in the first string, this will fail.
I suggest you do all that complicated data cleaning in a separate step first and inspect the results (use OBS= options while testing). In all your datasets, keep identification codes, serial numbers, account numbers and such as left-aligned character. Do NOT store such values as numbers. DON'T.
... View more