UPCASV: Creating a Variable Length Uppercase String

How to:

UPCASV converts alphabetic characters to uppercase, and is similary to UPCASE. However, 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)

where:

upper_limit

Integer

Is the limit for the length of the source string.

source_string

Alphanumeric of type An or AnV

is the string to convert to uppercase. If it is a field of type AnV, its length is taken from the length in bytes stored in the field. If upper_limit is smaller than the actual length, the source string is truncated to the upper limit.

output

Alphanumeric of type An or AnV

If the output format is AnV, the length returned is equal to the smaller of the source string length and 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