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)

where:

length

Integer

Is the number of characters in source_string and output.

input

Alphanumeric

Is the string to convert.

output

Alphanumeric of 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 String 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