WebSphere Message Brokers
File: ak05280_
Writer: Bill Oppenheimer

Reference topic

This build: July 31, 2007 21:31:48

UPPER and UCASE functions

UPPER and UCASE are equivalent string manipulation functions that manipulate CHARACTER string data and convert lowercase characters in a string to uppercase.

Syntax

UPPER and UCASE both return a new character string, which is identical to source_string, except that all lowercase letters are replaced with the corresponding uppercase letters.

For example:
UPPER('ABCD')
returns 'ABCD'.
UCASE('abc123')
returns 'ABC123'.
Converting characters from different code pages to uppercase

If you are using certain code pages, characters with no uppercase equivalent in your code page might be converted when you use the UPPER or UCASE function. This conversion happens because the bitstream is converted to a Unicode message tree by the message parser. Even though characters might have no uppercase equivalent in the source code page, they can still have an uppercase equivalent in the Unicode code page, and are converted by the UPPER or UCASE function. When the bitstream is converted back to the original code page, these characters cannot be converted back, and a substitution character is inserted into the output message for each character. The substitution character inserted depends on the original code page. For example, conversion to an EBCDIC code page inserts an X'3F' byte and conversion to a Japanese code page inserts an X'7F' byte.

A solution to this problem is to use the TRANSLATE function to convert selected characters to uppercase, instead of using the UPPER or UCASE function. Any characters that have no uppercase equivalent in the code page are excluded from the conversion.

In the following example, the input message is in code page 284, and the InputRoot.XML.MSG.APPDATA element contains characters that do not have an upper case equivalent in code page 284, but do have upper case equivalents in the Unicode code page. The TRANSLATE function is used to convert only the lowercase characters 'a' to 'z' to their equivalent uppercase characters. Any other characters in InputRoot.XML.MSG.APPDATA are excluded from the conversion.
DECLARE char1 CHAR;
SET char1 = TRANSLATE(InputRoot.XML.MSG.APPDATA,'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ');
SET OutputRoot.MQMD.CodedCharSetId = 284;
SET OutputRoot.XML.TEST.translated = char1;
Related concepts
ESQL overview
Related tasks
Developing ESQL
Related reference
TRANSLATE function
Syntax diagrams: available types
ESQL string manipulation functions
Notices | Trademarks | Downloads | Library | Support | Feedback

Copyright IBM Corporation 1999, 2007Copyright IBM Corporation 1999, 2007. All Rights Reserved.
This build: July 31, 2007 21:31:48

ak05280_ This topic's URL is: