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



Joe

It is possible for even microseconds not to be unique - I ran across this between 2 submitted jobs. There is an MI thing that does ensure uniqueness - MATTOD or MATMATR - it returns a 64-bit value. According to the V6R1 docs, bits 0-51 (starting on the left) contain microseconds count since somewhere in 1928, if I read the docs right. The older explanation was, bits 0-48 were the number of clock ticks - each was 8 microseconds long. Bits 52-63 are uniqueness bits - the system can ensure that the TOD returned has a unique value.

http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/topic/rzatk/MININ.htm#HDRTIMEFMT

is a link - click on "Standard time format" there. There are also several high-level APIs that can convert this into time structures that include microseconds.

I've often thought this returned value could make a unique 8-byte ID code. MATTOD is an easy call.

HTH
Vern


-------------- Original message --------------
From: Joe Pluta <joepluta@xxxxxxxxxxxxxxxxx>

mprice@xxxxxxxxx wrote:
From RPG manual:
If you ask for the difference in microseconds between two timestamps that
are more than 32 years 9 months apart, you will exceed the 15-digit limit
for duration values. This will result in an error or truncation.

Thanks. I missed that.

I'm trying to get a timestamp in milliseconds so that two stamps within
a second of each other get different values. Unfortunately, there's no
way to specify milliseconds on %diff, so I'm kind of stuck, unless I
want to use a closer date. 01/01/1970 happens to be something of a
standard. This is a tough limitation to work around.

Joe
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.

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.