UPCASV: Creating a Variable Length Uppercase String

How to:

The UPCASV function converts alphabetic characters in the source_string to uppercase and is similar to UPCASE. UPCASV can return AnV output whose actual length is the lesser of the actual length of the AnV source_string and an input parameter that specifies the upper_limit.


Top of page

x
Syntax: How to Create a Variable Length Uppercase String
UPCASV(upper_limit, source_string, output_format)

where:

upper_limit

Integer

Is the limit for the length of the source_string.

source_string

Alphanumeric of type AnV or An

Is the string to convert. If it is a field of type AnV, its length is taken from the length-in-bytes of the field. If the upper_limit is smaller than the length, the source_string is truncated to the upper_limit.

output_format

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.



Example: Creating a Variable Length Uppercase String

UPCASEV converts LAST_NAME_MIXED to uppercase and stores the result in a column with the format A15V:

UPCASEV(15, LAST_NAME_MIXED, 'A15V5')

For Banning, the result is BANNING.

For McKnight, the result is MCKNIGHT.


iWay Software