TAA Tools

The Retrieve  Time Stamp command  allows the  retrieval of the  current
date  and time from  the system values  in a  format that is  ready for
displaying  in a message  or for use  in an application  function.  One
or more different formats can be used.

All dates except for DATTIM26  are returned in job format.   The system
value QDATFMT is not considered.

For example,  assume you want to  place the current date  and time into
a message.  You would specify the following:

        DCL          &TIMESTAMP *CHAR LEN(17)
        SNDPGMMSG    MSG('Your job was completed on ' *CAT &TIMESTAMP)

The message would appear as:

           Your job was completed on 2/15 at 5:20 PM

One  or more  return values  are possible on  the command  depending on
the  type  of  format  that  you  want  to  use.    In  the   following
discussion, the date format is assumed to be MMDDYY.

The DATTIM26  return value is designed  for Z type data  base timestamp
fields.   The system clock only supports time as  a 9 digit value.  The
Z  type  field  supports  time  as  a  12  digit  value.    To  provide
uniqueness  for the  last  3  positions, a  user  space is  defined  in
TAATOOL  and is  retrieved and updated.   This  does not  reflect time,
but an increasing value.

The format of DATTIM26 is:


The  RTVTIMSTM2 command  provides significantly  better performance for
unique  time  stamps and  should  be  used  for  performance  sensitive

Command parameters                                    *CMD

      Keyword      Length     Format
      -------      ------     ------

      DATTIM23       23       12/31/09 at hh:mm:ss AM
      DATTIM20       20       12/31/09 at hh:mm AM
      DATTIM17       17       12/31 at hh:mm AM
      DATTIM16       16       12/31/09hh:mm:ss
      DATTIM12       12       123109hhmmss
      DATTIM15       15       123109hhmmssuuu (uuu is milliseconds)
      DATTIM26       26       2009-12-31-hh.mm.ss.nnnnnn
      DATE            8       12/31/09
      TIME            8       hh:mm:ss

For  the  DATTIM23,  DATTIM20  and  DATTIM17  values,  the  high  order
position  of both date  and time are  blanked out if they  are zero and
the value is left  adjusted unless the job date  format is *YMD.   'AM'
or 'PM'  is added after  the time.   If the  time is PM  (13:00:00 thru
23.59.59),  12 is subtracted  from the hour  and PM is  shown (the hour
12  is  also  described  as  PM).    For  example,  the  following   15
characters followed by two  blanks would appear in the  DATTIM17 return

          2/15 at 4:30 PM

Therefore, if  you are using the value  in a message and it  is not the
last field, you will want to use the *TCAT function as follows:

       SNDPGMMSG    MSG('On ' *CAT &TIMESTAMP *TCAT ' we ran your job')

The message would appear as:

       On 2/15 at 4:30 PM we ran your job


A *JUL job date format is not supported.




None, the tool is ready to use.

Objects used by the tool

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

   RTVTIMSTM     *CMD                      TAATIMD        QATTCMD
   TAATIMDC      *PGM          CLP         TAATIMDC       QATTCL

Added to TAA Productivity tools April 1, 1995

Home Page Up to Top