upperCaseChar()

The strLib.upperCaseChar() function returns a copy of a character-type value and sets all the lowercase characters in that copy to uppercase. Numeric values are not affected.

The function retains trailing blanks from the value of an input. If you want to strip trailing blanks from an input value that is of a type other than String, use the strLib.lowerCase() function instead.

To convert a character string to lowercase, use the strLib.lowerCaseChar() or strLib.lowerCase() function.

Syntax

  strLib.upperCaseChar(
    text CHAR? in)
  returns (result CHAR?)
text
Input can be any variable or expression that is assignment compatible with the CHAR type (see "Assignment compatibility in EGL").
result
A value of type CHAR. If text is null, the function returns a null value.

Example

Consider the following code:
function main()

   // each of the literals has 8 characters 
		myChar CHAR(5)       = "abc     "; 
		myUnicode UNICODE(5) = "abc     ";
		myString String      = "abc     ";
		
   sysLib.writeStdout(StrLib.upperCase(myChar) + 
      "is, for upperCase type Char");
   sysLib.writeStdout(StrLib.upperCaseChar(myChar) + 
      "is, for upperCaseChar type Char");
   sysLib.writeStdout(StrLib.upperCase(myUnicode) + 
      "is, for upperCase type Unicode");
   sysLib.writeStdout(StrLib.upperCaseChar(myUnicode) + 
      "is, for upperCaseChar type Unicode");		
		sysLib.writeStdout(StrLib.upperCase(myString) + 
      "is, for upperCase type String");
   sysLib.writeStdout(StrLib.upperCaseChar(myString) + 
      "is, for upperCaseChar type String");

end
The output is as follows:
ABCis, for upperCase type Char
ABC  is, for upperCaseChar type Char
ABCis, for upperCase type Unicode
ABC  is, for upperCaseChar type Unicode
ABC     is, for upperCase type String
ABC     is, for upperCaseChar type String

Compatibility

Table 1. Compatibility considerations for upperCaseChar
Platform Issue
COBOL generation The strLib.upperCaseChar() function has no effect on double-byte characters.

Feedback