Character String Data
A character string host variable is defined as an array of characters with a terminating null character ('\0').
The C definition for such a variable is:
char var1[n];
To define a character string variable, n must be a positive integer, value > 1.
At most, n-1 bytes of data are returned to the host variable.
One position is always reserved for the '\0' terminating null character. Let M be the length of the returned data.
Value |
TRANSACT Mode |
Description |
M <= n-1 |
BTET COMMIT 2PC |
|
ANSI |
The array is padded with blanks and ‘\0’ is placed in the M+1 position of the variable. |
|
M > n-1 |
any valid choice |
|
This variable has a type of 460 (461 if nullable), with a maximum length of n-1.
Actual length is determined by the position of the terminating null character ('\0').
DATE values can be returned to this type of field, providing the format chosen at precompile time fits in n-1 bytes. See “DATE(D|E|I|J|U) -d D|E|I|J|U” on page 75.