STRING

The primitive type STRING is composed of double-byte UNICODE characters.

You can store the value of the field in a file or database. If your code interacts with DB2® UDB, you must ensure that the code page for GRAPHIC data is UNICODE and that the column that stores the data item value is of SQL data type GRAPHIC or VARGRAPHIC.

For details on Unicode, see the web site of the Unicode Consortium (www.unicode.org).

The following syntax declares a limited-length string, which is a string that is restricted to a specified number of characters:
   varName STRING(lengthLimit);
varName
Name of the variable. For details on validity, see Naming conventions.
lengthLimit
An integer that represents the number of characters. The value is greater than zero.
When you specify a limited-length string as a function parameter whose modifier is OUT or INOUT, the length limit must be the same in argument and parameter. When you specify a limited-length string as a function parameter whose modifier is IN, any text input is valid. The following statements apply to the latter case as well as when you assign a value to a limited-length string:
The following statements apply to comparisons:

When you concatenate a limited-length string with another string, the contribution of the limited-length string depends on the value of build descriptor option itemsNullable. If the value of that option is YES, the limited-length string is padded with blanks to the last position specified in the string declaration. Otherwise, no padding occurs.

For details on comparisons, see Logical expressions. Also see Substrings.

Related reference
Assignment compatibility in EGL
Logical expressions
Naming conventions
Primitive types
Substrings

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