SQL/MP Programming Manual for COBOL

Character Processing Rules (CPRL) Procedures
HP NonStop SQL/MP Programming Manual for COBOL529758-003
11-5
CPRL_ARENUMERICS_
For other error codes, exceptcharaddr is set to an invalid address.
cprladdr pic S9(9) input
is a pointer to the SQL collation or collation object.
CPRL_ARENUMERICS_
The CPRL_ARENUMERICS_ procedure determines if all characters in a string are
numeric according to the specified SQL collation or collation object. You can also use
CPRL_ARENUMERICS_ to scan for the first nonnumeric character in a string.
The CPRL_ARENUMERICS_ procedure returns these error codes:
inputstring pic X(inputstringlength) input
is an array containing the data to be scanned.
inputstringlength pic S9(4) input
is the number of bytes in istring to be scanned.
exceptcharaddr pic S9(9) output
is set as follows:
If the call is successful, all the scanned characters are numeric characters, and
exceptcharaddr is set:
exceptcharaddr = address(inputstring) + inputstringlength
If -6 is returned, the first nonnumeric character in inputstring was found;
exceptcharaddr is set to the address of this character.
For other error codes, exceptcharaddr is set to an invalid address.
ENTER TAL "CPRL_ARENUMERICS_" USING
inputstring,
inputstringlength,
exceptcharaddr,
cprladdr,
GIVING errorcode.
Code Description
0 The operation was successful.
–2 The SQL collation or collation object is invalid.
–4 The version of the SQL collation or collation object is not supported.
–6 The input string contains a character not in the specified character class.