In reply to Rick Wicklin.

He simply runs your code, which fails, and you tell him that he forgot something? Sounds more like you forgot something.
Instead of
return X;
it must be
return(X);
at least this worked for me. Might be due to SAS Version?