E@DBLOCKGE

Name

The E@DBLOCKGE call has the following format:

DN@<Logical>(E@DBLOCKGE)

where <Logical> identifies the database file to use to perform the E@DBLOCKGE call.

Description

E@DBLOCKGE reads the record whose key field is greater than or equal to the values you set in the record retrieval variables (D@ fields) corresponding to the index key fields. This routine also readies the record for updating by E@DBSTORE).

Using the API in a Program

E@DBLOCKGE must be paired with E@DBLOCKNXT or E@DBLOCKPRV

E@DBLOCKGE does not need to point to an existing record (unlike the E@DBLOCKEQ routine). If you define a generic value for the record search, the routine may return a record and sets D<prefix>@NOTFOUND accordingly.

Input Values

Field Description
<Logical>

You must specify the database index name that you want to create a record in.

Note: If a key field in the index definition is declared as descending, populate that key field with a maximum value rather than a minimum value.
Record retrieval variables (also known as D@ fields)

You must populate the index key fields used to locate the record before using this call.

You do not need to fill all D@ fields with actual values, because the routine does not need to point to an existing record. Instead, you fill those fields that are not required as delimiters with zeros or spaces, depending on whether the fields are numeric or alphanumeric fields. If you need to know whether the record exactly matches the key fields you passed, you must check that the record matches the generic values you set.

Return Values

Field Description

D<prefix>@NOTFOUND

– or –

E@KEY@FOUND

The Modify 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

The following example shows the use of the modify calls to update a series of records in a file.

     EVAL      D@PSTN         = PWSSAVE#PSTN 
     EVAL      D@EFFCTD       = PWSSAVE#EFFCTD       
     EVAL      D@FLNBR        = 1                
     CALLP     DN@DBPAPPC1(E@DBLOCKGE)           
     DOW       DPPC@NOTFOUND = FALSE                   
               AND DPPCCMPNY = D@CMPNY                 
               AND DPPCPSTN = D@PSTN         
               AND DPPCEFFCTD = D@EFFCTD             
     CALLP     DPPC@IO(E@DBSTORE )                    DBPAPPC
     CALLP     DN@DBPAPPC1(E@DBLOCKNXT)