> -----Original Message----- > From: IBM Mainframe Discussion List On Behalf Of Eric Spencer > > Why not just consider the generated "key" (time stamp) a "seed" > If you detect that the generated key is a duplicate (when you do the > read for upd, which you have to do anyway) just add a second (or > less...) repeat read for upd until not dup then write the new record. > > No wait needed and "most" of the time you wont have a collision, if you > do it will resolve itself. This also solves the problem for future > machines that will make our current time granularity seem large.
That scheme also consumes resources (notably CPU) non-productively, though probably significantly less than the spin loop. Our unstated objective is to minimize non-productive resource consumption, and waiting for a timer to pop seems most efficient for that. > If your "key" is formatted (i.e. mmddyyyyhhmmss) and not just a stck > value then just convert it to STCK format before the add (in this case > you have to add a second, or you'll end up with the same key) then back > to mmddyy... after... probably still way more efficient than a STIMER. I suggested almost exactly that, about a decade ago: change the key field from "human-readable" YYYY-MM-DD-HH-MM-SS to "raw" STCKE. "Too much work" and similar "reasons" expressed eloquently by John McKown. -jc- ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html