Unconfigured Ad Widget

Collapse

Announcement

Collapse
No announcement yet.

Bypass record locked

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

  • Bypass record locked

    Where is the SETGT to skip past the locked record? Chris

  • #2
    Bypass record locked

    Chris, Thank you, I put SETGT after reading the locked record and it just do the trick. This routine will help the operation deals with message wait and the program being cancelled because of record lock. TIKI

    Comment


    • #3
      Bypass record locked

      tiki wrote: > > Chris, > Thank you, I put SETGT after reading the locked record and it just do the trick. This routine will help the operation deals with message wait and the program being cancelled because of record lock. TIKI, another way to skip a locked record is to do another READE without a lock, using the (N) extender.

      Comment


      • #4
        Bypass record locked

        How to check if record was locked in /free format (without indicator), my example above uses indicator. Thanks, TIKI

        Comment


        • #5
          Bypass record locked

          tiki wrote: > > How to check if record was locked in /free format (without indicator), my example above uses indicator. Use the (E) extender instead of the error indicator, and then test it with %error(). reade(e) ordKey ord100a; if %error(); locked#=locked# + 1;

          Comment


          • #6
            Bypass record locked

            I am writing a batch program that update a masterfile, however a record might be locked by a user. What I did was to read the record and if its used, bypass it and read the next record. When I tried to read the next record, the program indicated that it was also locked but in reality it was not, so the program treat all the succeeding records as locked. on CL I did an override: OVRDBF FILE(FILEX) WAITRCD(*IMMED). Any help will be appreciated. I also try monitor, on-error and the result still the same. TIA, TIKI
            Code

            Comment


            • #7
              Bypass record locked

              Note: The rules for locking are different if your job is running under commitment control. If the update operation changes a key field in an access path for which immediate maintenance is specified, the access path is updated if the high-level language allows it. (Some high-level languages do not allow changes to the key field in an update operation.) If you request a read operation on a record that is already locked for update and if your job is running under a commitment control level of *ALL or *CS (cursor stability), then you must wait until the record is released or the time specified by the WAITRCD parameter on the create file or override commands has been exceeded. If the WAITRCD time is exceeded without the lock being released, an exception is returned to your program and a message is sent to your job stating the file, member, relative record number, and the job which has the lock. If the job that is reading records is not running under a commitment control level of *ALL or *CS, the job is able to read a record that is locked for update.

              Comment

              Working...
              X