In this datastep:

data class_anon (drop=name salt_key);
length name_hashed salt_key $128;

set sashelp.class;

* In real use, you should store the salt key somewhere else than a
literal string in your code. Also, I had to break the hex value show
here across multiple lines go get it to render properly in Wordpress -
it should all be one long string with no whitespace or line breaks;
salt_key = '9D91D63B23DB252EB9AD7EFE9A6E7120
8C139AEC1E721635E9EF8D39DF7D5AF5
5E707AD54E03631F130D3F87EA62AC8B
04209ED276317E12D17DE3CF9578D1B9';

name_hashed = %trim(put(sha256(cat(salt_key,strip(name))),hex128.));
run;

Why do you use %trim()?
If you want to trim, you should use trim(), not %trim()

To see what I mean, try to run this datastep and see that %trim() does not work as you expect, but trim() does:
data test;
a="xx ";
b=%trim(a)!!"x";
c=trim(a)!!"x";
run;