LOCASE: Converting Text to Lowercase

How to:

Available Languages: reporting, Maintain

The LOCASE function converts alphanumeric text to lowercase. It is useful for converting input fields from FIDEL CRTFORMs and non-FOCUS applications to lowercase.


Top of page

x
Syntax: How to Convert Text to Lowercase
LOCASE(length, string, outfield)

where:

length

Integer

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

string

Alphanumeric

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

outfield

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 string.



Example: Converting a Field 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