TAA Tools
CVTBIN8         CONVERT BINARY 8                       TAACLQV

The Convert Binary 8  command allows conversion of an  8 byte character
input field  (containing a binary value) to a  20 byte character return
variable.   This  allows for conversion  of large binary  values.  Most
HLLs allow only for  2 or 4 byte  binary values.  Only positive  values
are returned.

See the CVTTOBIN8 command for the inverse function.

A typical command would be:

             DCL        &BINARY *CHAR LEN(8)
             DCL        &CHAR20 *CHAR LEN(20)
             CVTBIN8    BININP8(&BINARY) RTNVAL(&CHAR20)

The  return value  must be  specified as  *CHAR LEN(20).    The largest
value   of  X'FFFFFFFFFFFFFFFF'  would   provide  a   return  value  of
18,446,744,073,709,551,615 (without the commas).

RPG supports up to 31 digits.

CL supports a maximum of  15 digits for a  field.  The function can  be
used in  CL if the high  order 5 digits are  zero.  If zero,  you could
substring out the low order 15 digits.

CVTBIN8 escape messages you can monitor for

None, but escape messages from based on functions will be re-sent.

Command parameters                                    *CMD

   BININP8       The  binary  input field.    It must  be  8  bytes and
                 contain binary data.

   RTNVAL        The value returned.   It  must be  specified as  *CHAR
                 LEN(20) and  will contain the  largest value  that can
                 be  specified in  8 bytes  of  binary.   Only positive
                 values are returned.

Calling the CPP directly

The  TAACLQVR CPP  can be  called directly.   The following  is RPG III
code in a format that is ready to be copied:

     C                     CALL 'TAACLQVR'                 CVTBIN8

     C                     PARM           BIN8    8        Bin 8 input
     C                     PARM           RTNVAL 20        Return value


Because the command returns a  variable, it may only be specified  in a
CL program.

CL supports  a maximum of 15  digits for a decimal  field thus limiting
the function in a CL program.




None, the tool is ready to use.

Objects used by the tool

   Object        Type    Attribute      Src member    Src file
   ------        ----    ---------      ----------    ----------

   CVTBIN8       *CMD                   TAACLQV       QATTCMD
   TAACLQVR      *PGM       RPG         TAACLQRR      QATTRPG

Added to TAA Productivity tools March 1, 1999

Home Page Up to Top