Cody,
It seems that your code does not work under NON-ASCII value.
E.X.
If I put some Chinese character like "美国美国" in "c:\books\functions\plaintext.txt" .
And I got garbles character after decoding .

The most simple way is re-encode it like:

data x;
x='America美国';
y=put(x,hex32.);
z=input(y,$hex32.);
run;
proc print;run;