Admin Production rocket
Current Publication

Fixed-length Character Strings

Enterprise Developer for Eclipse (including UNIX Components) V7.0
Rocket® Enterprise Developer (formerly a product of Micro Focus or formerly a product of Open Text) documentation, created before Rocket Software acquired certain products from OpenText, may include outdated references to "Micro Focus" or "OpenText", both of which are trademarks of OpenText or its affiliates. Rocket Software is not affiliated with Micro Focus or OpenText and has since rebranded these products as Rocket® products. You may also encounter outdated links in this documentation. If you do, please contact Rocket Support (support@rocketsoftware.com) for assistance.

Fixed-length Character Strings

Fixed-length character strings (CHAR) are SQL data types with a driver-defined maximum length. They are declared in COBOL as:
PIC X(n)
where n is an integer between 1 and the maximum length.

Host Variable Formats

OpenESQL and DB2 ECM
01 char-field1      PIC X(5).
01 char-field2      PIC X(254).

The largest supported fixed length character string is 254 bytes for the DB2 ECM. If you need a character string greater than 254 bytes in length, use a VARCHAR field.

OpenESQL trims trailing spaces from input parameters before sending them to the database server. Trimming the trailing spaces can improve performance when comparing CHAR and VARCHAR values.

Important: For OpenESQL, the database server pads the value with spaces as necessary. When space padding is required for a host variable used in an expression, use an explicit SQL CAST function to ensure that the server converts the host variable to the required data type.
OpenESQL
01 char-field3      SQL TYPE IS CHAR(200).

The char-field3 format uses the CHAR SQL TYPE.

OpenESQL JVM Managed Runtime
In addition to the definitions valid for OpenESQL, the following definition is also valid for the OpenESQL JVM Managed Runtime:
01 char-net         string(200).