× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



fkany@xxxxxxxxxxxxxxxxxx wrote:
I'm trying to have a program detect if a record is locked.  If the program
does find that the record it's trying to read is locked, it will wait 10
seconds before retrying to  read the same record from the file.

Will placing the ITER operation accomplish this task in the code below?
Should it wait 15 seconds then SETLL on the record it was trying to read
then ITER?

Is there an easier alternative for checking for locked records?

Here is what we do (not too fancy since we are on older releases):


FPROCHP    UF A E           K DISK    INFDS(infds)
(skip infds definition)
Dallocate_record  PR                  LIKE(ERA_errno)
Dprocnum                         4S 2 VALUE
...
C                   eval      err = allocate_record(proc)
C     err           ifeq      FAIL
C                   select
C                   when      ifstatus = RECORDLOCKED
C                   eval      message = 'The procedure you selected is ' +
C                             'in use.'
C                   when      ifstatus = RECORDNOTFOUND
C                   eval      message = 'The procedure you selected is ' +
C                             'not found.'
C                   other
C                   eval      message = 'Could not allocate record.'
C                   endsl
...
Pallocate_record  B
Dallocate_record  PI                  LIKE(ERA_errno)
Dprocnum                         4S 2 VALUE
C     prochkey      klist
C                   kfld                    procnum
C     prochkey      chain     PROCHR                             1919
C     *in19         ifeq      *on
C                   return    FAIL
C                   endif
C                   return    SUCCESS
Pallocate_record  E

We have some constants defined in a header file (like SUCCESS, FAIL, etc.). Basically you use the infds to tell you if the record is locked and then do something with that info (in this case send a message).
James Rich



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.