810-RECREATE-<FileName>

Name

810-RECREATE-<FileName>

Description

810-RECREATE-<FileName> 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

<FileName>

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

Programming Example

The following example shows the 810-RECREATE-<FileName> call used to add a series of new records that are very similar to each other:

  • Use 910-AUDIT-BEGIN to open the transaction state.

  • Another routine (5500-MAKE-FIRST-RECORD) is called to add a record in the SALESREP file.

  • The subsequent PERFORM loop adds more records with the same information as the first record, with the exception of new salesman numbers and names.

  • The 810-RECREATE-SALESREP call adds a new record that has the same field values as the previously defined record.

  • Another routine gets the new number and name, which are then moved into the appropriate record area fields.

  • The 820-STORE-SALESREP call adds the new record to the file.

  • The 920-AUDIT-END call closes the transaction state and commits the transaction.

***  This routine adds records for a series of sales reps. 
***  All of the fields have the same values to be entered 
***  except for SALESMAN and NAME.
*
          PERFORM 910-AUDIT-BEGIN.

          PERFORM 5500-MAKE-FIRST-RECORD.
          PERFORM
              UNTIL (NO-MORE-SALESREPS)
              PERFORM 810-RECREATE-SALESREP
              PERFORM 5550-GET-NEW-SALESREP-INFO
              MOVE WS-NEW-SALESREP           TO SAW-SALESMAN
              MOVE WS-NEW-NAME               TO SAW-NAME
              PERFORM 820-STORE-SALESREP
          END PERFORM.

          PERFORM 920-AUDIT-END.