SQL/MP Programming Manual for COBOL

Character Processing Rules (CPRL) Procedures
HP NonStop SQL/MP Programming Manual for COBOL529758-003
11-16
CPRL_GETNEXTINSEQUENCE_
laststringmaxlength pic S9(4) input
specifies the maximum length of laststring.
laststringlength pic S9(4) output
specifies the number of bytes of laststring that were scanned. (When
CPRL_GETFLAST_ is successful, laststringlength and
laststringmaxlength will be equal.)
cprladdr pic S9(9) input
is a pointer to the SQL collation or collation object.
CPRL_GETNEXTINSEQUENCE_
The CPRL_GETNEXTINSEQUENCE_ procedure finds the next string after a specified
string according to an SQL collation or collation object.
This procedure replaces the practice of adding 1 to the least significant character of a
string to find the next greater string, which does not work correctly for non-binary
collating sequences.
The CPRL_GETNEXTINSEQUENCE_ procedure returns these error codes:
inputstring pic X(inputstringlength) input
is an array containing the input string.
inputstringlength pic S9(4) input
is the number of bytes in the input string inputstring.
ENTER TAL "CPRL_GETNEXTINSEQUENCE_" USING
inputstring,
inputstringlength,
nextstring,
nextstringmaxlength,
nextstringlength,
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.
–20 The user-specified buffer is not large enough to receive the returned string.
–23 The inputstring parameter is already the maximum string of length
inputstringlength.
–24 The input string is longer than the maximum length (256 bytes).