CHKNUM: Checking a String for Numeric Format

How to:

The CHKNUM function checks a character string for numeric format. If the string contains a valid numeric format, CHKNUM returns the value 1. If the string contains characters that are not valid in a number, CHKNUM returns zero (0).


Top of page

x
Syntax: How to Check the Format of a Character String
CHKNUM(numchar, source_string, output)

where:

numchar

Integer

Is the number of characters in the string.

string

Alphanumeric

Is the character string to be checked.

output

Numeric



Example: Checking a String for Numeric Format

CHKNUM examines STR1 for numeric format.

CHKNUM(8, str1, 'I1')

For 12345E01, the result is 1.

For ABCDEFG, the result is 0.


iWay Software