× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: Timestamp field
  • From: "Scott Klement" <infosys@xxxxxxxxxxxx>
  • Date: 20 Jan 2000 17:32:02 -0600

Hi Marc,

zylka.marc@westpoint-stevens.com wrote:
>
> Using RPG/IV on V4R1, we are filling a field declared as type
>  timestamp using the following:
>
> C       time        qhtmsp
>
> This line of code does not set the last 3 digits of the field, they
> are 000.  This is causing a duplicate timestamp in the file when
> we'd like for it to be unique.  Is there anything else that does
> besides moving a 3 digit sequence number to it?
>
> TIA,
> Marc Zylka

I use the following code (you can put it in a service program or
whatever) to populate my timestamp fields.

Hope that helps...



     P*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     P* This gets the current system time...
     P*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
     P GetTime         B                   EXPORT
     D GetTime         PI              Z

     D peLilian        S             10I 0
     D peSeconds       s              8A

     D peGregor        ds
     D   dsGYear               1      4A
     D   dsGMonth              5      6A
     D   dsGDay                7      8A
     D   dsGHour               9     10A
     D   dsGMin               11     12A
     D   dsGSec               13     14A
     D   dsGMilli             15     17A

     D dsTimeStmp      ds
     D   dsTS                  1     26Z
     D   dsYear                1      4A
     D   dsMonth               6      7A
     D   dsDay                 9     10A
     D   dsHour               12     13A
     D   dsMin                15     16A
     D   dsSec                18     19A
     D   dsMilli              21     23A

     D wkInitTS        S               Z

     c                   eval      dsTS = wkInitTS

     C                   callb     'CEELOCT'
     c                   parm                    peLilian
     c                   parm                    peSeconds
     c                   parm                    peGregor

     c                   eval      dsYear = dsGYear
     c                   eval      dsMonth = dsGMonth
     c                   eval      dsDay = dsGDay
     c                   eval      dsHour = dsGHour
     c                   eval      dsMin = dsGMin
     c                   eval      dsSec = dsGSec
     c                   eval      dsMilli = dsGMilli

     c                   return     dsTS

     P                 E
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---


As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.