Midrange News for the IBM i Community


Posted by: basticar
Legacy Programmer
PriceSmart
San Diego, CA USA
How to get around a simple record lock
has no ratings.
Published: 02 Sep 2011
Revised: 23 Jan 2013 - 1611 days ago
Last viewed on: 21 Jun 2017 (5524 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

How to get around a simple record lock Published by: basticar on 02 Sep 2011 view comments(2)

Well, figured the best way to try out the new forums is to list a problem and see how it goes.  1st off . . . the code I pasted in from RDp isn't quite ledgible, so I'm fixing that.

Below is some pretty standard code in the JDE applications which I *thought* would bypass a locked record.  Apparently it does NOT!  I thought the ITER here would cause the next record to be read, but what I'm seeing in the debugger is that the cursor is sitting on the same record and trying and retrying to read that one locked record, sigh. 

What the heck is that 2nd indicator for if this sort of logic won't work? 

Bob - in reading your book, it's very clear what is suppose to happen on a read, but I'm not finding anything addressing this simple, common record lock issue.  Is there an easy remedy for this or am I going to have to do a pssr type of routine to try and kick the cursor down a knotch?

This program needs to update the target record, but it's not urgent.  This runs in batch everynight and is ok if it skips the locked record and picks it up the next time . . . but I can't get it to skip LO

 ~ suprized and somewhat frustrated ~ Carol

 

C   *IN99 DOUEQ *ON

C            READ F55634LB                      9699

  

C   *IN99 IFEQ *ON

C            LEAVE

C            ENDIF

 

 

C    *IN96 IFEQ *ON

C             ITER

C             ENDIF

~ do processing

C             ENDDO

 

PS ~ YES I know this is old freaking code and s/b rewritten, but we have a gigaton of this code around that has been working for eons (errrr well we *thought* it was working!) and no time to rewrite it all now . . . so do please bear with me :p

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS