Convert Case<

CvtCase

The CvtCase procedure converts alphabetic characters to upper or lower case using a language-safe translation table.

varying-char-value CvtCase(
  szInputString    65535A   Const Varying 
  nOption             10I 0 Const Options(*NOPASS)
)

See also: ToUpper, ToLower

Parameters

szInputString
[input VChar(*) const]  A varying or fixed-length character value whose length is 1 to 65535. The value of this parameter is not modified but is translated to all lowercase or all uppercase letters using an internal buffer. The translated value is returned.
nOption  [optional] default(CC_TOUPPER)
[input in(4) const]  This parameter controls the conversion process. A value of 1 (X'F1') causes the procedure to convert the input text to lowercase. A value of 0 (X'F0') causes the procedure to convert the input text to uppercase (this is the default).
Symbolic Named Constant Value Description
CC_TOUPPER 0 Converts the input value to uppercase.
CC_TOLOWER 1 Converts the input value to lower case.

Return Value

If the function succeeds, the return value is the szInputString parameter's value converted to upper or lower case. If the function fails, no value is returned, that is the return value is and empty string, or blanks.

Example

.....DName+++++++++++EUDS.......Length+TDc.Functions+++++++++++++++++++++++++
     D Company         S             50A   Inz('Lunar Spacecraft Company')
     D WrkName         S             50A   
 
.....CSRn01..............OpCode(ex)Extended-factor2++++++++++++++++++++++++++

     C                   Eval      WrkName = CvtCase(Company : CC_TOUPPER)

Remarks

This procedure uses the OS/400 QlgConvertCase API to do the conversion using a language-safe translation table. It is called by the ToUpper and ToLower procedures to perform case conversion. ToUpper and ToLower are provided as external interfaces and should be used instead of CVTCASE. The interface to ToUpper and ToLower is fixed, whereas the call interface to CVTCASE may change on future releases.