As per the code, in the compress function used compress(x, 'ABCD', 'L'), we are suggesting compress to remove "ABCD" and any lower case letters, so even though the ABCD are all in caps, since we have mentioned them in compress function they are getting removed, in case you wish to remove only the lower case letters then try compress(x,, 'L'), this will remove only the lower case letters the output will be 123-4567-8901 B 234-5678-9012 /*code*/ data test; x='123-4567-8901 B 234-5678-9012 c'; y=compress(x,,'L'); proc print; run; Thanks, Jagadish
... View more