I lost the chain where Booth, I think, was looking at some aspects of
the timestamp functions on the system. I responded that fractional
seconds are easily obtained using the "current timestamp" special SQL
register - so I thought I'd better test things. Bruce had already done
some of this, I hope this isn't superfluous.
No matter what I did, the %timestamp BIF resolves only to milliseconds.
In the example below, they are all equal - because it ran so quickly.
The SQL approach resolves to as many fractional seconds as the target
variable allows. This is what I would use if I needed the finest
granularity, for uniqueness, I believe.
I didn't test the QWCCVTDT API, which, however, is limited to
microseconds = 6 fractional seconds, as Bruce pointed out. The
additional uniqueness digits, IIRC, are available using an MI function,
MATTOD - it's been awhile since playing with this, so I might have it
// Use *SYS in BIF
tstmp06sys = %timestamp(*sys : 6);
tstmp12sys = %timestamp(*sys : 12);
// Use SQL current timestamp
set :tstmp06s = current timestamp;
set :tstmp12s = current timestamp(12);
set :tstmp06sfrom12 = current timestamp(12);
set :tstmp12sfrom06 = current timestamp;
This mailing list archive is Copyright 1997-2022 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
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.