UPCASE: Converting Text to Uppercase

How to:

The UPCASE function converts a character string to uppercase. It is useful for sorting on a field that contains both mixed-case and uppercase values. Sorting on a mixed-case field produces incorrect results because the sorting sequence in EBCDIC always places lowercase letters before uppercase letters, while the ASCII sorting sequence always places uppercase letters before lowercase. To obtain correct results, define a new field with all of the values in uppercase, and sort on that.


Top of page

x
Syntax: How to Convert Text to Uppercase
UPCASE(length, source_string, output_format)

where:

length

Integer

Is the number of characters in the source_string and output_format.

source_string

Alphanumeric

Is the string to convert.

output_format

Alphanumeric type AnV or An

If the format of the output_format is AnV, then the length returned is equal to the smaller of the source_string length and the upper_limit length.



Example: Converting a Mixed-Case Field to Uppercase

UPCASE converts LAST_NAME_MIXED to uppercase and stores the result in a column with the format A15:

UPCASE(15, LAST_NAME_MIXED, 'A15')

For Banning, the result is BANNING.

For McKnight, the result is MCKNIGHT.


iWay Software