Is there an easy test whether a value is numeric? (to avoid accepting a 'O' for '0',eg)
The function name should read verify() not validate().
If you wish to test for a numeric value. If you're looking for an integer value, then
is what you're looking for. Either one will return "1" (true) if the value is valid, or "0" (false) if it doesn't pass.
Note some pitfalls here:
Datatype(N) as well as datatype(W) recognize a string like '0E00' as numeric. I fell into this trap on a mainframe with a DASD address like that. '0E00' is taken as a valid exponential notation for zero.
Datatype(W) also recognizes '1.000' as whole number.
If I want to test for figures only (like: 123), I use validate().