Generating a Unique Identifier
July 26, 2002 Timothy Prickett Morgan
Hey, Ted:
I just read your article, “Using Timestamps as Unique Keys,” in the July 17 issue of Midrange Guru, OS/400 Edition.
|
There might be a better way of creating a unique ID, one that doesn’t require retries. It’s the GENUUID API and/or MI built-in.
Universal Unique Identifier (UUID) is supposed be a totally unique ID, even across all the machines in the entire world. I’m assuming that in reality this is 100 percent true, but I wouldn’t worry about it.
Here’s some code that I’ve had stashed away:
H option(*NoSrcStmt) DftActGrp(*No) D UUIDTemplate ds D BytesProv 10u