───DATATYPE(string ─┬─────────┬─)──────
└──,type──┘
DATATYPE determines whether 'data' is numeric or alphabetic and returns a result of NUM or CHAR. If only string is specified, the returned result is NUM if string is a valid REXX number (any format); otherwise CHAR will be the returned result.
If type is specified, the returned result is 1 if string matches the type; otherwise, a 0 is returned. If string is null, 0 is returned (except when type is X, which returns 1). The following is a list of valid types. Only the capitalized letter is significant (all others are ignored).
Alphanumeric
DATATYPE(' 12 ') -> 'NUM'DATATYPE('') -> 'CHAR'
DATATYPE('123*') -> 'CHAR'
DATATYPE('12.3','N') -> 1
DATATYPE('12.3','W') -> 0
DATATYPE('Fred','M') -> 1
DATATYPE('','M') -> 0
DATATYPE('Fred','L') -> 0
DATATYPE('?20K','S') -> 1
DATATYPE('BCd3','X') -> 1
DATATYPE('BC d3','X') -> 1