LOCASV: Creating a Variable Length Lowercase String

How to:

The LOCASV function converts alphabetic characters in the source_string to lowercase and is similar to LOCASE. LOCASV returns AnV output whose actual length is the lesser of the actual length of the AnV source string and the value of the input parameter upper_limit.


Top of page

x
Syntax: How to Create a Variable Length Lowercase String
LOCASV(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 An or AnV

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 this upper_limit.

output_format

Alphanumeric of type AnV or An

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



Example: Creating a Variable Length Lowercase String

LOCASV converts LAST_NAME to lowercase and specifies a length limit of five characters. The results are stored in a column with the format A15V:

LOCASV(5, LAST_NAME, 'A15V')

For SMITH, the result is smith.

For JONES, the result is jones.


iWay Software