The %DATATYP autocall macro is very useful in this area. When passed a value, it will tell you whether the string is numeric or character. This is especially useful in macro-world where all values are handled as character strings. The following code snippet gives an introduction to its usage:
%if %datatyp(&data) ne CHAR %then...
%if %datatyp(&mult) ne NUMERIC %then...
The macro is smart enough to recognise 1.23E3 as numeric, i.e. 1230.
An alternative DATA Step approach is to use the INPUT function with the question mark (?) or double question mark (??) modifier in order to avoid messages being written to the log.
/* Check that Y (a char var) contains a valid numeric value */
if input(y,??best.) eq . then
... <not numeric>
Whatever approach you take, a little parameter validation is better than none and will undoubtedly repay you at some point in the future.