Database Examples

The following examples illustrate when FILEDATA creates a database and when it reuses an old database.

New Database Example

In this example, the "ATTRIBUTES:ALL" request causes a new database to be created. This database is reused for the FILENAMES request in the reused database example.

RUN *SYSTEM/FILEDATA("ATTRIBUTES:ALL;FILENAMES")

Reused Database Example

In this example, the STRUCTUREMAP request reuses the existing database titled MYDB ON DISK. The FILENAMES and HEADERCONTENTS requests both create new databases, because each includes a DIRECTORY modifier. Only the database created by HEADERCONTENTS includes raw headers.

RUN *SYSTEM/FILEDATA("STRUCTUREMAP:DATABASE=MYDB;FILENAMES:DIRECTORY=A;
HEADERCONTENTS:DIRECTORY=B")

Combined New and Reused Database Example

In this example, the FILENAMES request creates a database because FILENAMES is the first request, and the CHECKERBOARD request creates a database because of the DIRECTORY modifier. Raw disk file headers are included in both these databases because of the RAWHEADERS modifier. The ATTRIBUTES request reuses the database from the CHECKERBOARD request.

RUN *SYSTEM/FILEDATA("FILENAMES:RAWHEADERS;
CHECKERBOARD:DIRECTORY=A RAWHEADERS;
ATTRIBUTES:MAXRECSIZE MINRECSIZE BLOCKSIZE")