TAA Tools
CVTTOBYT        CONVERT TO BYTES                       TAACLTC

The  Convert  to  Bytes command  allows  a  conversion  from  bytes  to
kilobytes,  megabytes,  etc.   The  companion command  is  Convert From
Bytes which converts from kilobytes, megabytes etc to bytes.

A typical CVTTOBYT command would be:

             DCL        &BYTES *DEC LEN(15 0)
              .
             CVTTOBYT   INPUT(nnnn) INPTYPE(*KB) BYTES(&BYTES)

For  example, if the INPUT  value is 2, the  BYTES value will be 2,048.

A typical CVTFRMBYT command would be

             DCL        &OUTPUT *DEC LEN(15 3)
              .
             CVTFRMBYT  BYTES(nnnn) OUTTYPE(*KB) OUTPUT(&OUTPUT)

For example,  if the BYTES  value is  6000, the OUTPUT  value would  be
5.859 kilobytes.

CVTTOBYT escape messages you can monitor for
--------------------------------------------

      TAA9891    The value is larger than 15 digits.

Escape messages from based on functions will be re-sent.

CVTFRMBYT escape messages you can monitor for
---------------------------------------------

None.  Escape messages from based on functions will be re-sent.

CVTTOBYT Command parameters                           *CMD
---------------------------

   INPUT         The decimal  input value to  be converted.   The value
                 allows  for 12 whole  numbers and  3 decimal positions
                 and may  be  entered with  a  number  such as  100  or
                 100.123.

   INPTYPE       The input  type to be converted.   It must be  a value
                 of   *KB  =   Kilobytes,  *MB   =  Megabytes,   *GB  =
                 Gigabytes, or *TB = Terabytes.

   BYTES         The converted  value in  bytes.   This is  a  required
                 return  variable  that  must  be   specified  as  *DEC
                 LEN(15 0).


CVTFRMBYT Command parameters                          *CMD
----------------------------

   BYTES         The  number  of  bytes to  be  converted.    Up to  15
                 digits may be entered.

   OUTTYPE       The  output type  to convert to.   It must  be a value
                 of  *KB   =  Kilobytes,   *MB  =   Megabytes,  *GB   =
                 Gigabytes, or *TB = Terabytes.

   OUTPUT        The  converted  value  in kilobytes,  megabytes,  etc.
                 This  is  a  required  return  variable  that must  be
                 specified as *DEC LEN(15 3).


Restrictions
------------

Because the  commands  return  variables, CVTTOBYT  and  CVTFRMBYT  may
only be used in a CL program.

Prerequisites
-------------

The following TAA Tools must be on your system:

     SNDESCINF       Send escape information
     SNDESCMSG       Send escape message

Implementation
--------------

None, the tool is ready to use.

Objects used by the tool
------------------------

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

   CVTTOBYT      *CMD                   TAACLTC       QATTCMD
   CVTFRMBYT     *CMD                   TAACLTC2      QATTCMD
   TAACLTCC      *PGM       CLP         TAACLTCC      QATTCL
   TAACLTCC2     *PGM       CLP         TAACLTCC2     QATTCL

Structure
---------

CVTTOBYT    Cmd
   TAACLTCC   CL pgm

CVTFRMBYT   Cmd
   TAACLTCC2  CL pgm
					

Added to TAA Productivity tools March 21, 2008


Home Page Up to Top