FIXEDBIN Function

Purpose

Returns a FIXED BIN value with precision and scale.

Syntax

FIXEDBIN(x[,p[q]])

Parameters

x
An expression.
p
A restricted expression specifying the fixed binary precision in the result. This value must not exceed the implementation limit.
q
A restricted expression specifying the scaling factor of the result. When omitted, a scaling factor of zero is assumed.

If both p and q are omitted, the precision and scale are determined from the source as follows, where M is the maximum Fixed Binary precision and N is the maximum Fixed Decimal precision:

Source code Result
FIXED BIN(p,q) FIXED BIN(r,s)
FIXED DEC(p,q) FIXED BIN(r,s)

where r = min(M,1+CEIL(p*3.32)

and s = CEIL(ABS(q*3.32))*SIGN(q)

FLOAT BIN(p) FIXED BIN(p,0)
FLOAT DEC(p) FIXED BIN(r,0)

where r = min(M,CEIL(p*3.32))

BIT FIXED BIN(M,0)
CHAR, GRAPHIC or WIDECHAR FIXED DEC(r,0)

where r = min(M,1+CEIL(N*3.32))