LIMITS
The LIMITS option specifies various implementation limits.
- EXTNAME
- Specifies the maximum length for the EXTERNAL name. The maximum value for n is 100; the minimum value is 7.
- FIXEDDEC
- Specifies the maximum precision for FIXED DECIMAL to be either
15 or 31. The default is FIXEDDEC(15,31).
If FIXEDDEC(15,31) is specified, you can declare FIXED DECIMAL variables with precision greater than 15, but unless an expression contains an operand with precision greater than 15, the compiler uses 15 as the maximum precision for all arithmetic.
FIXEDDEC(15,31) will provide much better performance than FIXEDDEC(31).
FIXEDDEC(15) and FIXEDDEC(15,15) are equivalent; similarly, FIXEDDEC(31) and FIXEDDEC(31,31) are equivalent.
FIXEDDEC(31,15) is not allowed.
- FIXEDBIN
- Specifies the maximum precision for SIGNED FIXED BINARY to be
either 31 or 63. The default is (31,63).
If FIXEDBIN(31,63) is specified, you can declare 8-byte integers, but unless an expression contains an 8-byte integer, the compiler uses 4-byte integers for all integer arithmetic.
Note, however, that specifying the FIXEDBIN(31,63) or FIXEDBIN(63) option might cause the compiler to use 8-byte integer arithmetic for expressions mixing data types. For example, if a FIXED BIN(31) value is added to a FIXED DEC(13) value, the compiler will produce a FIXED BIN result, and under LIMITS(FIXEDBIN(31,63)) that result would have a precision greater than 31 (because the FIXED DEC precision is greater than 9). When this occurs, the compiler will issue informational message IBM2809.
FIXEDBIN(31,63) will provide much better performance than FIXEDBIN(63).
FIXEDBIN(31) and FIXEDBIN(31,63) are equivalent; similarly, FIXEDBIN(63) and FIXEDBIN(63,63) are equivalent.
FIXEDBIN(63,31) and FIXEDBIN(31,31) are not allowed.
The maximum precision for UNSIGNED FIXED BINARY is one greater, that is, 32 and 64.
- NAME
- Specifies the maximum length of variable names in your program. The maximum value for n is 100; the minimum value is 31.
- STRING
- Accepts these values as the threshold for the length of a BIT, CHARACTER, GRAPHIC,
UCHAR, or WIDECHAR variable:
32K, 64K, 512K, 8M, and 128M. The following table
shows these values' corresponding limits and required options that
must be in effect:
Values Corresponding limits (Threshold) Required options must be in effect 32k 32767 64k 65535 BIFPREC(31) 512k 524287 BIFPREC(31) and CMPAT(V3) 8M 8388607 BIFPREC(31) and CMPAT(V3) 128M 134217727 BIFPREC(31) and CMPAT(V3) Note:- 32K is the default value.
- The maximum value allowed for VARYING is 64K.
- The BIFPREC(31) option must be in effect to use STRING(64K), but the CMPAT(V3) option is not needed.
The STRING(64K) option permits VARYING strings to be longer even though they will still have a 2-byte length prefix (unlike VARYING4 strings which have a 4-byte length prefix). But if the STRING limit is greater than 64K, a CHAR VARYING variable can be used as a SQL VARCHAR only if its length is less than 64K.
