E@DBFINDNXT

Name

The E@DBFINDNXT call has the following format:

DN@<Logical>(E@DBFINDNXT)

where <Logical> identifies the database file and index to use to perform the E@DBFINDNXT call.

Description

Once you have defined a position in the file with a successful E@DBFINDGE, use the E@DBFINDNXT routine to process database records sequentially in Index order. This routine reads the record following the current record for this index.

Using the API in a Program

E@DBFINDGE must precede a E@DBFINDNXT.

Input Values

Field Description
<Logical> <Logical> identifies the database file and index to use to perform the call.

Return Values

Field Description
D<prefix>@NOTFOUND

Each routine sets the logical value <FileName>-NOTFOUND or <FileName>-FOUND based on the outcome of the read process.

The Find routines set D<prefix>@NOTFOUND to FALSE if a record is found, TRUE if a record is not found, or E@KEY@FOUND if the keys are found.

Programming Example

This example processes a set of records for a particular subaccount from a specific company account. The first three lines show the key fields being set for the appropriate company, account, and subaccount combination. The index has two other key fields in it, so lines four and five fill those fields with blank values, because they are not going to be used as delimiters.

Once all the index key fields have been populated, the DN@DBIFGLM1(E@DBFINDGE) routine uses the specified index to get the first record defined by the key fields. Four conditions are then defined to see if the retrieved record fits the desired set. If so, the record is processed, and E@DBFINDNXT retrieves the next record for checking and processing. Processing continues until DN@DBIFGLM1(E@DBFINDNXT) routine returns a value that violates one of the four checking conditions.


*** Process a set of records using E@DBFINDGE and E@DBFINDNXT
      EVAL      D@CMPNY        = F1@TCMPNY
      EVAL      D@ACCUNT       = DGLMACCUNT                
      EVAL      D@SBACCN       = DGLMSBACCN               
      EVAL      D@VRLVLS       = *ZEROS                   
      EVAL      D@ACCNT        = *BLANKS 
      CALLP     DN@DBIFGLM1(E@DBFINDGE)
      DOW       DGLM@NOTFOUND  = FALSE                 
                OR DGLMCMPNY  <> D@CMPNY             
                OR DGLMACCUNT <> D@ACCUNT
                OR DGLMSBACCN <> D@SBACCN
      CALLP     S1@L422                      Process Detail
      CALLP     DN@DBIFGLM1(E@DBFINDNXT)