SQL/MP Programming Manual for COBOL

Character Processing Rules (CPRL) Procedures
HP NonStop SQL/MP Programming Manual for COBOL529758-003
11-15
CPRL_GETLAST_
The CPRL_GETFIRST_ procedure returns these error codes:
firststring pic X(firststringmaxlength) output
is an array in which CPRL_GETFIRST_ returns the first string.
firststringmaxlength pic S9(4) input
is the maximum length of firststring.
firststringlength pic S9(4) output
specifies the number of bytes of firststring that were scanned. If the call is
successful, firststringmaxlength and firststringlength will be equal.
cprladdr pic S9(9) input
is a pointer to the SQL collation or collation object.
CPRL_GETLAST_
The CPRL_GETLAST_ procedure finds the last string of a specified length according
to an SQL collation or collation object.
This procedure replaces the practice of using a string of binary ones to generate the
last string of a specified length, which does not work correctly for non-binary collating
sequences.
The CPRL_GETLAST_ procedure returns these error codes:
laststring pic X(laststringmaxlength) output
is an array in which CPRL_GETFIRST_ returns the last string.
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.
ENTER TAL "CPRL_GETLAST_" USING
laststring,
laststringmaxlength,
laststringlength,
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.