The following table shows the system functions in the strLib library. Subsequent tables show the strLib variables and constants.
| System function and invocation | Description |
|---|---|
| result = booleanAsString (value ) | Returns the string "true" or the string "false" based on a Boolean value. |
| result = byteLen (source ) | Returns the number of bytes in a variable, excluding any trailing spaces and null values. |
| result = characterLen (source) | Returns the number of characters in a text expression, excluding any trailing spaces or null values. |
| result = charAsInt (text ) | Returns an integer code point corresponding to a character. |
| result = clip (text [, code]) | Deletes leading/trailing blanks and nulls from character strings. |
result = formatDate (dateValue |
Formats a DATE value and returns a STRING value. |
result = formatNumber (numericExpression, |
Returns a number as a formatted string. |
result = formatTime (timeValue |
Formats a parameter into a time value and returns a STRING value. The default format is the format specified in the current locale. |
result = formatTimestamp (timestampValue |
Formats a parameter into a timestamp value and returns a value of type STRING. The DB2® format is the default format. |
token = getNextToken (source, index, |
Returns the next token in a string. |
| result = getTokenCount (source, delimiters) | Returns the number of tokens in a source string. |
| result = indexOf (source, pattern [, startPosition] ) | Returns an index into a string of characters. The index indicates where a specified pattern begins. |
| result = intAsChar (integer) | Returns a character that corresponds to an integer code point. |
| result = intAsUnicode (integer) | Returns a Unicode character that corresponds to an integer code point. |
| result = lowerCase (text) | Returns a copy of a character-type value and sets all the uppercase characters in that copy to lowercase. If the input value is of a type other than String, a data conversion strips trailing blanks from the input value before the function is invoked. |
| result = lowerCaseChar (text) | Returns a copy of a character-type value and sets all the uppercase characters in that copy to lowercase. The function retains trailing blanks. |
| setBlankTerminator (target) | Replaces a null terminator and any subsequent characters in a string with spaces. |
| setNullTerminator (target) | Changes all trailing spaces in a string to null values. |
| result =spaces (characterCount) | Returns a string of a specified length. |
| result = unicodeAsInt (integer) | Returns an integer that corresponds to a Unicode character. |
| result = upperCase (text) | Returns a copy of a character-type value and sets all the lowercase characters in that copy to uppercase. If the input value is of a type other than String, a data conversion strips trailing blanks from the input value before the function is invoked. |
| result = upperCaseChar (text) | Returns a copy of a character-type value and sets all the lowercase characters in that copy to uppercase. The function retains trailing blanks. |
The following table shows the system variables in the strLib library.
| System variable | Description |
|---|---|
| defaultDateFormat | Specifies a default pattern to convert a DATE to text. |
| defaultMoneyFormat | Specifies a default pattern to convert a MONEY type to text. |
| defaultNumericFormat | Specifies a default pattern to convert a number to text. |
| defaultTimeFormat | Specifies a default pattern to convert a TIME to text. |
| defaultTimestampFormat | Specifies a default pattern to convert a TIMESTAMP to text. |
The following table shows the system constants in the strLib library.
| System constant | Description |
|---|---|
| db2TimestampFormat | The pattern yyyy-MM-dd-HH.mm.ss.SSSSSS, which is the IBM® DB2 default timestamp format. |
| eurDateFormat | The pattern dd.MM.yyyy, which is the IBM European standard date format. |
| eurTimeFormat | The pattern HH.mm.ss, which is the IBM European standard time format. |
| isoDateFormat | The pattern yyyy-MM-dd, which is the date format that the International Standards Organization (ISO) specifies. |
| isoTimeFormat | The pattern HH.mm.ss, which is the time format that the International Standards Organization (ISO) specifies. |
| jisDateFormat | The pattern yyyy-MM-dd, which is the Japanese Industrial Standard date format. |
| jisTimeFormat | The pattern HH:mm:ss, which is the Japanese Industrial Standard time format. |
| nullFill | The empty string (""), which is used to initialize a character variable to a null value. |
| odbcTimestampFormat | The pattern yyyy-MM-dd HH:mm:ss.SSSSSS, which is the Open Database Connectivity timestamp format. |
| usaDateFormat | The pattern MM/dd/yyyy, which is the IBM USA standard date format. |
| usaTimeFormat | The pattern hh:mm a, which is the IBM USA standard time format. |
| Platform | Issue |
|---|---|
| Rich UI | The following strLib functions are not supported:
|