LOCASE: Converting Text to Lowercase

How to:

Available Languages: reporting, Maintain

The LOCASE function converts alphanumeric text to lowercase.


Top of page

x
Syntax: How to Convert Text to Lowercase
LOCASE(length, source_string, output)

where:

length

Integer

Is the number of characters in source_string and output, or a field that contains the length. The length must be greater than 0 and the same for both arguments; otherwise, an error occurs.

source_string

Alphanumeric

Is the character string to convert in single quotation marks, or a field or variable that contains the string.

output

Alphanumeric

Is the name of the field in which to store the result, or the format of the output value enclosed in single quotation marks. The field name can be the same as source_string.



Example: Converting a String to Lowercase

LOCASE converts the LAST_NAME field to lowercase and stores the result in LOWER_NAME:

TABLE FILE EMPLOYEE
PRINT LAST_NAME AND COMPUTE
LOWER_NAME/A15 = LOCASE(15, LAST_NAME, LOWER_NAME);
WHERE DEPARTMENT EQ 'MIS';
END

The output is:

LAST_NAME        LOWER_NAME
---------        ----------
SMITH            smith
JONES            jones
MCCOY            mccoy
BLACKWOOD        blackwood
GREENSPAN        greenspan
CROSS            cross

WebFOCUS