E@DBRECREATE
Name
The E@DBRECREATE call has the following format:
DN@<Logical>(E@DBRECREATE)
where <Logical> identifies the database file to use to perform the E@DBCREATE call.
Description
E@DBRECREATE leaves the record area unchanged so that you can make new records based on the values in an existing record.
Using the API in a Program
See the Programming Example in this section.
Input Values
Field | Description |
---|---|
<Logical> | You must specify the database file name that you want to create a record in. |
Programming Example
The following example shows the E@DBRECREATE call used to add a series of new records that are very similar to each other:
-
Use U@AUDITBEGIN to open the transaction state.
-
A series of EVAL statements sets the D@ fields, and then a call to a Modify API (E@DBLOCKGE) retrieves the first record whose key fields are greater than or equal to the values set in the record retrieval variables (D@ fields).
-
If a record is found, it is deleted then recreated (DVDR@IO(E@DBDELETE), then DVDR@IO(E@DBRECREATE)).
-
The current address flag is set to "Y" for this record and the record is stored with DVDR@IO(E@DBSTORE).
-
The code then checks for records where the current address flag should not be "Y". These are deleted and recreated also, the current address flag is set to spaces, and the record is stored with DVDR@IO(E@DBSTORE).
-
The U@AUDITEND call closes the transaction state and commits the transaction.
|