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. 

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. 

p.s. I'm not a cobol (is that how you spell it) programmer... don't have
any idea if the facilities are available to convert into/out of STCK
format. 

Eric Spencer
Neon Enterprise Software Inc. 



-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On
Behalf Of Chase, John
Sent: Wednesday, November 12, 2008 1:21 PM
To: [email protected]
Subject: Access STIMER(M) from COBOL program?

Wonderful tool, Strobe.

We've discovered among our "ancient" production code a COBOL program
that constructs VSAM KSDS record keys of date/time with one-second
granularity.  As we've installed newer, faster machines over the years,
the COBOL program tended to generate more and more "duplicate keys",
which VSAM dislikes rather intensely.  Since initially there did not
seem to be a batch equivalent to EXEC CICS DELAY, the "programmer du
jour" coded a spin loop within the program to make it "watch the clock"
waiting for the next second to arrive.  It spins real fast on a z9-EC.

Is there a way within COBOL to set a timer to "pop" a second later, and
have the program just WAIT on it?  Or is this a potential "opportunity"
for me to grind the rust off my atrophied Assembler skills and cobble up
a "delay" routine the COBOL program could call?

TIA,

    -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

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

Reply via email to