Pervasive logo

Prev Advanced Operations Guide Next

Data


The commands in the Data menu allow you to import, export, and copy records in data files. You can also recover data after a system failure with the Roll Forward feature. See Roll Forward Command for a discussion of Roll Forward.

Importing and Exporting ASCII File Format

When you save data, records in the ASCII file have the following format. You can use an ASCII text editor to create files that you can load, as long as they adhere to these specifications. Note that most text editors do not support editing binary data.

Figure 14-12 shows the correct format for records in the input ASCII file. For this example, the data file has a defined record length of 40 bytes.

 
Figure 14-12 Format for Records in Input Sequential Files

Data Tasks

You can perform the following data tasks with the Maintenance utility:

Importing Records From an ASCII File

You can use the Maintenance utility to import records from an ASCII file to a standard data file. This operation does not perform any conversions on the data. You can create an import file using a text editor or the Maintenance utility (see Exporting Records to an ASCII File ).

To import ASCII data

  1. Click Data4Load from the main menu. The Load dialog box appears (Figure 14-13).

     
    Figure 14-13 Load Dialog Box

The ASCII file you specify must adhere to the specifications explained in Importing Records From an ASCII File . The record length of the standard data file you specify must be compatible with the records in the ASCII file.

  1. Click Execute to import the records.

    While importing data, the Maintenance utility shows the number of records being imported, the percentage of records imported, and a status message. You can continue working in the Maintenance utility (for example, you can open another Load dialog box).

Exporting Records to an ASCII File

You can use the Maintenance utility to export records from a data file to an ASCII file.

To export ASCII records

  1. Click Data4Save from the main menu. The Save Data dialog box appears (Figure 14-14).

     
    Figure 14-14 Save Data Dialog Box

  1. In the Save Data dialog box, specify the following options.
    From MicroKernel File
    Specifies the name of the existing MicroKernel-compatible file you want to save.
    To Sequential File
    Specifies the name of the sequential file to create.
    Use An Index
    Uses a specified index when sorting the records for export. By default, the Maintenance utility does not use an index, meaning that records are exported according to their physical position in the data file.

    Internal Index #:
    Uses the specified key number. Click Refresh Index List to update the available indexes if you change file in the From MicroKernel File box.

    External Index File:
    Uses the specified external index. (To create an external index, refer to Creating Indexes .)
    Direction
    Forward: This is the default setting and indicates the utility recovers the file from the beginning.

    Backward: This option recovers data from the end of the file.

    Forward and Backward: This option reads the file forward until it fails. Then it starts at the end of the file and reads the file backward until it reaches the record that failed previously or encounters another failure.

    Backward and Forward: Indicates the utility reads the file backward until it fails. Then it starts at the beginning of the file and reads the file forward until it reaches the record that failed previously or encounters another failure.
  2. Click Execute to export the data. The Maintenance utility creates the specified ASCII file using the format described in Importing Records From an ASCII File . You can then edit the ASCII file and use the Load command to import the edited text to another standard data file, as described in Importing Records From an ASCII File .

Copying Records Between Data Files

You can use the Maintenance utility to copy data from one Microkernel data file to another. The record lengths for both data files you specify must be the same.

To copy records between MicroKernel data files

  1. Click Data4Copy from the main menu. The Copy Data dialog box appears (Figure 14-15).

     
    Figure 14-15 Copy Data Dialog Box

  1. Enter the name of the file you want to copy in the From MicroKernel File box and then specify the path where you want to copy the file in the To MicroKernel File box.

    The record lengths for both data files you specify must be the same.

Recovering (Roll Forward) Changes to a Data File

See the Logging, Backup, and Restore chapter .


Prev
Indexes
Contents
Up
Check for Revisions
Next
Btrieve Command-Line Maintenance Utility (BUTIL)