× 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.



The program never successfully reads the "locked" record, so you don't move 
forward through the access path.

One solution would be to read it with no lock first, then CHAIN out to the file 
for update.  If that chain fails, read the next record.

Michael

> I am having a problem with a program that deletes records from a file based 
> on a range.
> 
> The program just reads and deletes the results of an OPNQRYF selection but if 
> a record is locked its supposed to write it
> out and go to the next record.
> My problem is that when a record is locked I never get passed the Read 
> statement.
> 
> The file has a Maximum record wait time of *NOMAX,  so in the CLLE I do an 
> Override to change this to *IMMED:
> 
>  OVRDBF     FILE(TEST) WAITRCD(*IMMED) SECURE(*YES) +
>                    OVRSCOPE(*CALLLVL) SHARE(*YES) +
>                    SEQONLY(*YES 341)
> 
> The RPGLE pgm reads the records and monitors for an error condition.
> 
> h DFTACTGRP(*NO) ACTGRP(*caller) bnddir('QC2LE')
> 
> FTEST      UF   E             DISK
> 
> //*---------------------------------------------------------------
> //  sbDltTest: Read and Delete records from Test file.
> //*---------------------------------------------------------------
>    Begsr    sbDltTest;
> 
>      @StartTime = %timestamp;
> 
>      read(e)  test;
>    // Indicate if record is locked.
>        if %error;
>             exsr sbLckRtn;
>        Endif;
> 
> 
> The CLLE program is compiled in a *NEW activation group and the RPGLE runs in 
> the callers group. I have checked the Overrides in place when the lock occurs 
> and they are there for the test file but control is never returned on the 
> READ(E) opcode, so it never goes to the next step.
> 
> It looks very straightforward but I must be missing 
> something.
>

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.