ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

File Locking

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • File Locking

    Hi,

    My program reads records by a logical file (LF1) and diaplaying it in a subfile and updating the record by chaining through another logical file LF2.
    But the chain operation getting following exception. LF1 and LF2 are logical of PF1.


    Record 1 member LF2 already locked to this job.
    C
    I/O error CPF5032 was detected in file LF2.
    Function check. RNX1299 unmonitored by XXXE1 at statement 0000034300,
    instruction X'0000'.
    The call to PROCESSSF1 ended in error (C G D F).



    Please help me to solve this issue.

  • #2
    Re: File Locking

    somewhere else in the program you are doing a chain or read to an update file
    without the (n) nolock.
    -- or -- after a chain you have some logic the excludes some records from being updated.

    you can fix this by using the (N) on reads and chains where there is no update
    or use the unlock keyword
    PHP Code:
    finnonhda  uf   e           k disk       
    chain
    (N) (companycompanyh5Math5Analh5Sizeh5Lin:        
              
    Location_DS.BayLocation_DS.RowLocation_DS.Section
              
    Location_DS.Shelfinnonhda;                           
    If %
    Found(innonhda);                                             
     
    s5OnHand inlcnq;                                              
    endif; 
    PHP Code:
     *                                                                  
    C                   IF        (DASRVC 72 OR DASRVC 80) AND      
    C                             IDINVUNIT 'LB'                      
    C                   MOVE      'Y'           INV87                   
    C                   UNLOCK    INSFTRNB                              
    C                   
    ELSE                                            
    C                   Z-ADD     RTCOST        ISCST                   
    C                   UPDATE    INSFTRNR                              
    C                   
    ENDIF 
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment

    Working...
    X