$ matches the end of the string. I guess this is looking for strings that end with a space followed by two non-space characters. If match, then extract those two characters to string claim_state and remove them from the string. It could be done with:
if prxmatch('/\s\S\S$/', strip(claim_txn_merchant_clean)) then do;
claim_temp = strip(claim_txn_merchant_clean);
drop claim_temp;
claim_state = substr(claim_temp, length((claim_temp)-1, 2);
claim_txn_merchant_clean = substr(claim_temp, 1, length(claim_temp)-3);
end;
PG