Contents


Supported Macros


Decimals are defined by an encoded length - the total number of significant digits (precision), and the significant digits to the right of the decimal (scale). The following macros handle decimal length:  

Macro Description
DECLEN(m,n) Calculates the minimum number of bytes necessary to hold a decimal ( m = precision, n = scale)
DECLENGTH(length) Calculates the minimum number of bytes necessary to hold a decimal, given the encoded length
DECPREC(size) Calculates a default precision, given the size (the number of bytes used to store a number)
PRECTOT(length) Returns the precision from an encoded length
PRECDEC(length) Returns the scale from an encoded length
PRECMAKE(p,s) Returns the encoded decimal length from a precision and scale

The following macros allow you to obtain the size information stored  by the database server for a VARCHAR column:

Macro Description
MAXVCLEN (255) The maximum number of characters allowed in a VARCHAR column
VCMIN(size)  To get the minimum number of characters that you can store in a VARCHAR column
VCLENGTH(len)  The length of the host variable
VCMAX(size)  To get the maximum number of characters that you can store in a VARCHAR column
VCSIZ(max, min)   To get the encoded size for the VARCHAR column