SQL/MP Programming Manual for COBOL

Character Processing Rules (CPRL) Procedures
HP NonStop SQL/MP Programming Manual for COBOL529758-003
11-6
CPRL_COMPARE1ENCODED_
cprladdr pic S9(9) input
is a pointer to the SQL collation or collation object.
CPRL_COMPARE1ENCODED_
The CPRL_COMPARE1ENCODED_ procedure compares two strings according to an
SQL collation or collation object. The first string is assumed to be in encoded form, and
the second is assumed to be in original (not encoded) form. For strings of unequal
length, the procedure logically pads the shorter string with blanks.
Use the CPRL_COMPARE1ENCODED_ procedure to compare a constant with a set
of values in one pass. The procedure encodes as much of the second string as
necessary to perform the compare, and the overhead of repeatedly encoding the
constant is saved.
The CPRL_COMPARE1ENCODED_ procedure returns these error codes:
string1 pic X(string1length) input
is an array containing the first string to be compared. string1 is assumed to be
in encoded form.
string1length pic S9(4) input
is the number of bytes in string1 to be compared.
string2 pic X(string2length) input
is an array containing the second string to be compared. string2 is assumed to
be in original (not encoded) form.
string2length pic S9(4) input
is the length of string2.
ENTER TAL "CPRL_COMPARE1ENCODED_" USING
string1,
string1length,
string2,
string2length,
result,
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.