TAA Tools
CVTDTS          CONVERT DTS                            TAADATM

The Convert  DTS  command converts  the internal  format for  date/time
known as  *DTS into CYYMMDD and HHMMSS return  values.  The *DTS format
appears  in various  places such  as in  message data and  API formats.
The QWCCVTDT API is used.

A typical command would be:

             DCL         &RTNDATE *CHAR LEN(7)
             DCL         &RTNTIME *CHAR LEN(6)
             DCL         &DTS *CHAR LEN(8)
                         /* Get *DTS value from some API */
              .
             CVTDTS     DTS(&DTS) RTNDATE(&RTNDATE) +
                          RTNTIME(&RTNTIME)

Either or both the date and time may be returned.

The companion  command is  CVTTODTS which  converts to  a *DTS  format.
This  can be  helpful  if attempting  to  use the  MSGDTA parameter  on
SNDPGMMSG  for a system message where  one of the sub  fields is a *DTS
type.

CVTDTS Command parameters                             *CMD
-------------------------

   DTS           The 8 byte internal format used for date/time.

   RTNDATE       The return date  in the format CYYMMDD.   If used,  it
                 must be declared as *CHAR LEN(7).

   RTNTIME       The return  time in  the format HHMMSS.   If  used, it
                 must be declared as *CHAR LEN(6).

CVTTODTS Command parameters                           *CMD
---------------------------

   DATE          The date to be converted in CYYMMDD format.

   TIME          The time to be converted in HHMMSS format.

   MILLISEC      The milliseconds  to be converted.   The default is 0.

   DTS           The  return  value  in  *DTS  format.    It  must   be
                 specified as *CHAR LEN(8).

Calling the CVTDTS CPP directly
-------------------------------

The CVTDTS CPP  can be called directly  such as with the  following RPG
code:

     C                     CALL 'TAADATMC'                 CVTDTS
     C                     PARM xxx       DTS     8        DTS format
     C                     PARM           RTNDAT  7        CYYMMDD
     C                     PARM           RTNTIM  6        HHMMSS

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

Because  the command  returns  values,  it can  only  be used  in  a CL
program.

The QWCCVTDT API has some restrictions.

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

None.

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

None, the tool is ready to use.

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

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

   CVTDTS        *CMD                   TAADATM       QATTCMD
   CVTTODTS      *CMD                   TAADATM2      QATTCMD
   TAADATMC      *PGM       CLP         TAADATMC      QATTCL
   TAADATMC2     *PGM       CLP         TAADATMC2     QATTCL

Structure
---------

CVTDTS      Cmd
   TAADATMC   CL pgm

CVTTODTS    Cmd
   TAADATMC2   CL pgm
					

Added to TAA Productivity tools May 1, 1996


Home Page Up to Top