× 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.



Booth, SQL's current timestamp is already  completely out to microseconds - CL's RTVJOBA with retrieveing datetime into 20 digits goes out to microseconds

It has been available a long time to use
EXEC SQL SET :TMSTMPFLD = current timestamp;
to get microseconds in RPG.

In more recent versions, SQL can return even more granularity.

Regards
Vern

On 12/7/2019 4:07 PM, Booth Martin wrote:
But how many of the decimal characters were non-zero?  I did a test to see if I could get more than 4 valid decimal places using every on-board method of establishing current date/time that I could think of.

I could add seconds, like %timestamp(*SYS: 12) + %seconds(0.000056789012), and that worked just fine, but I could not seed current date with valid micro seconds beyond 4 places.


On 12/7/2019 2:01 PM, Bruce Vining wrote:
Just for fun I threw together a test case of SQL current timestamp vs
QWCCVTDT (*YYMD, 20-byte receiver).  Both were accessing microseconds and
the loop for each was 1,000,000 iterations.  The API "won" every time
though not by a whole lot.  The percentage longer using the SQL route  was
13%, 7%, and 7% over the API approach.

Note all the typical disclaimers of the system not being dedicated, etc.
I'll also add that the*very first time*  I ran the SQL part of the program
it took substantially longer and so I did not include that very first run
in the above timings.  The percentages are based on subsequent runs of the
program.


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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.