SQL/MP Programming Manual for COBOL85
Character Processing Rules (CPRL) Procedures
HP NonStop SQL/MP Programming Manual for COBOL85—429326-004
11-11
CPRL_ENCODE_
shiftedstringmaxlength pic S9(4) input
specifies the maximum length of shiftedstring; it must be greater than equal to 
inputstring.
shiftedstringlength pic S9(4) output
specifies the length of the downshifted string returned in shiftedstring.
cprladdr pic S9(9) input
is a pointer to the SQL collation or collation object.
CPRL_ENCODE_ 
The CPRL_ENCODE_ procedure encodes a character string so that a subsequent 
binary comparison will produce the proper results for the specified SQL collation. Use 
CPRL_ENCODE_ in situations where the number of encodings required is 
substantially less than the number of comparisons (for example, during a sort).
The CPRL_ENCODE_ procedure returns these error codes: 
decodedstring pic X(decodedstringlength) input
is an array containing data to be encoded.
decodedstringlength pic S9(4) input
is the number of bytes in decodedstring to be encoded.
encodedstring pic X(encodedstringmaxlength) output
is an array in which CPRL_ENCODE_ returns the encoded string. Overlapping 
decodedstring and encodedstring causes unpredictable results. 
ENTER TAL "CPRL_ENCODE_" USING
 decodedstring,
 decodedstringlength,
 encodedstring,
 encodedstringmaxlength,
 encodedstringlength,
 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. 










