Midrange News for the IBM i Community


Posted by: Deepak Deshpande
AS/400 Freelance Programmer/Analyst
India
Record lock situation
has no ratings.
Published: 08 Dec 2011
Revised: 23 Jan 2013 - 1978 days ago
Last viewed on: 24 Jun 2018 (4216 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.

Record lock situation Published by: Deepak Deshpande on 08 Dec 2011 view comments(3)

Hi

I have an interesting situation. In our order processing system, we have a series of programs. Since there are multiple ways (Punched/Through FTP/Through Telxon units etc.) in which order gets created, the entry programs are different. 

So far, we had about 6 to 7 members (Ex. FTP/POS/TLX etc.) in our order file where the orders get created through work file & then the subsequent flow is same for all members until orders get transferred to 'ORDER' member.

Today I added a new member and a new entry point for orders. All programs work fine except one RPG program. This particular program reads LF1(NEWMBR) & updates LF2(NEWMBR). Both LFs are in UPDATE mode. Here I get a record lock condition. Please see the code below.

 

FLF1     UF  E           K        DISK
FLF2     UF  E           K        DISK

I@REC1
I              FLD1                            XFLD1
I              FLD2                            XFLD2


C           KEY2      SETLL LF2
C           *INLR     DOUEQ'1'
C           KEY2      READE LF2                      LR
C           *INLR     IFEQ '0'
C           KEY1      CHAIN LF1                     91

Since READE would lock the record, CHAIN would fail. But how did it work earlier?

I am on V6R1, if it helps.

Totally clueless on this, any help appreciated.

 

TIA,
Deepak 

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

COMMENTS