EGL library StrLib

The next table shows the system functions in the library StrLib and is followed by tables that show the variables and constants in that library.

System function and invocation Description
result = characterAsInt (text ) Converts a character string into an integer string corresponding to the first character in the character expression.
result = clip (text ) Deletes trailing blank spaces and nulls from the end of returned character strings and can be used to test for NULL.
result = compareStr (target, targetSubstringIndex, targetSubstringLength, source, sourceSubstringIndex, sourceSubstringLength) Compares two substrings in accordance with their ASCII or EBCDIC order at run time and returns a value (-1, 0, or 1) to indicate which is greater.
result = concatenate (target , source) Concatenates target and source; places the new string in target; and returns an integer that indicates whether target was long enough to contain the new string
result = concatenateWithSeparator (target, source, separator) Concatenates target and source, inserting separator between them; places the new string in target; and returns an integer that indicates whether target was long enough to contain the new string
copyStr (target, targetSubstringIndex, targetSubstringLength, source, sourceSubstringIndex, sourceSubstringLength) Copies one substring to another
result = findStr (source, sourceSubstringIndex, sourceSubstringLength, searchString) Searches for the first occurrence of a substring within a string

result = formatDate (dateValue
[, dateFormat
])

Formats a date value and returns a value of type STRING. The default format is the format specified in the current locale.

result = formatNumber (numericExpression,
numericFormat)

Returns a number as a formatted string.

result = formatTime (timeValue
[, timeFormat])

Formats a parameter into a time value and returns a value of type STRING. The default format is the format specified in the current locale.

result = formatTimeStamp (timestampValue
[, timestampFormat])

Formats a parameter into a timestamp value and returns a value of type STRING. The DB2® format is the default format.
result = getNextToken (target, source, sourceSubstringIndex, sourceStringLength, characterDelimiter) Searches a string for the next token and copies the token to target
result = integerAsChar (integer) Converts an integer string into a character string.
result = lowerCase (text) Converts all uppercase values in a character string to lowercase values. Numeric and existing lowercase values are not affected.
setBlankTerminator (target) Replaces a null terminator and any subsequent characters in a string with spaces, so that a string value returned from a C or C++ program can operate correctly in an EGL-generated program
setNullTerminator (target) Changes all trailing spaces in a string to nulls
setSubStr (target, targetSubstringIndex, targetSubstringLength, source) Replaces each character in a substring with a specified character
result =spaces (characterCount) Returns a string of a specified length.
result = strLen (source) Returns the number of bytes in an item, excluding any trailing spaces or nulls
result = textLen (source) Returns the number of bytes in a text expression, excluding any trailing spaces or nulls
result = upperCase (characterItem) Converts all lowercase values in a character string to uppercase values. Numeric and existing uppercase values are not affected.

The next table shows the system variables in the library StrLib.

System variable Description
defaultDateFormat Specifies the value of defaultDateFormat, which is one of several masks that can be used to create the string returned by the function StrLib.formatDate.
defaultMoneyFormat Specifies the value of defaultMoneyFormat, which is one of several masks that can be used to create the string returned by the function StrLib.formatNumber.
defaultNumericFormat Specifies the value of defaultNumericFormat, which is one of several masks that can be used to create the string returned by the function StrLib.formatNumber.
defaultTimeFormat Specifies the value of defaultTimeFormat, which is one of several masks that can be used to create the string returned by the function StrLib.formatTime.
defaultTimestampFormat Specifies the value of defaultTimestampFormat, which is one of several masks that can be used to create the string returned by the function StrLib.formatTimestamp.

The next table shows the system constants in the library StrLib. All are of type STRING.

System constant Description
db2TimestampFormat The pattern yyyy-MM-dd-HH.mm.ss.ffffff, 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 specified by the International Standards Organization (ISO).
isoTimeFormat The pattern HH.mm.ss, which is the time format specified by the International Standards Organization (ISO).
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.
odbcTimestampFormat The pattern yyyy-MM-dd HH:mm:ss.ffffff, which is the ODBC timestamp format.
usaDateFormat The pattern MM/dd/yyyy, which is the IBM USA standard date format.
usaTimeFormat The pattern hh:mm AM, which is the IBM USA standard time format.

Related reference
formatDate()
formatNumber()
formatTime()
formatTimeStamp()

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.