IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

UUID4 - extracting time element


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jzhardy

New User


Joined: 31 Oct 2006
Posts: 91
Location: brisbane

PostPosted: Thu Apr 22, 2021 1:00 pm
Reply with quote

I'm looking to encode the system timestamp (down to milliseconds or better) into the fewest possible number of bits, and hoping I could cheat by pulling this info directly out of UUID4

a sample generated UUID is:

58d5e212-165b-4ca0-909b-c86b9cee0111

from the definition I get:

Code:

   Field                  Data Type     Octet  Note
                                        #

   time_low               unsigned 32   0-3    The low field of the
                          bit integer          timestamp

   time_mid               unsigned 16   4-5    The middle field of the
                          bit integer          timestamp

   time_hi_and_version    unsigned 16   6-7    The high field of the
                          bit integer          timestamp multiplexed
                                               with the version number 


which means 8 bytes. Can this be improved upon ? And what precision does this actually represent in the seconds part (ie, milliseconds or microseconds) ?
Back to top
View user's profile Send private message
jzhardy

New User


Joined: 31 Oct 2006
Posts: 91
Location: brisbane

PostPosted: Thu Apr 22, 2021 1:25 pm
Reply with quote

ok, from what i've since learnt, the precision on the low is in 100 nanosecond units. Pls correct me if this is incorrect.

based on that, i could probably lose 13 bits from time_low to keep within millisecond precision.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts DFSORT to add 6 hours to time(tdate-t... DFSORT/ICETOOL 16
No new posts Cobol-db2 : SQL query is running for ... DB2 4
No new posts Issues with outrec overlay while extr... SYNCSORT 7
No new posts Modify Several JCLs at the Same Time JCL & VSAM 6
No new posts Map a data element to SPACES if it is 0 COBOL Programming 2
Search our Forums:

Back to Top