Creating a File

When you first create a file, the command automatically creates a dictionary. You can then create multiple data sections that are associated with that dictionary. The file is listed in the account's Master Dictionary (MD) and the data sections are listed as file definition items in the file's dictionary. For example, assume a file called TEST1 is created and two data sections TEST2 and TEST3 are created in addition to the default data section; the MD of the account and the dictionary of the file then contain the following items:

Example file with dictionary and three data sections

The following paragraphs outline in more detail the creation of a file. For complete information, see User's Reference: General.

General Procedure

To create a dictionary and a default data section, enter at the TCL prompt:

CREATE-FILE fileName dictModulo dataModulo

where:

dictModulo is the modulo of the dictionary.

dataModulo is the modulo of the data section.

Following execution of the FDB-SET command, CREATE-FILE can be used to create Reality files on a foreign (SQL-based) database. In this case, the selected modulo is ignored. Commands to delete, copy, move or rename files created on a foreign database work in the usual way, but on the foreign database rather than on the local Reality database.

Creating a Data Section

Additional data sections can be created next. The syntax is as follows:

CREATE-FILE file-name, data-name modulo

where:

data-name is the name of the additional data section to be created.

modulo is the modulo of the new data section.

Examples

You want to maintain an inventory file by location. The first data section is for the headquarters site and others are maintained for the branches. All the files are identified by location code.

The procedure is as follows:

  1. At the TCL prompt, enter:

    CREATE-FILE INV.HQ 5 11

    This displays:

    [417] File 'INV.HQ' created.
    D code =DL, modulo =5, separ = 1
    [417] File 'INV.HQ' created.
    D code =DL, modulo =11, separ = 1
  2. To create an additional data section, enter:

    CREATE-FILE INV.HQ,INV.LGB 11

    This displays the message:

    [417] File 'INV.LGB' created.
    D code =DL, modulo =11, separ = 1

    DICT INV.HQ then contains the following items:

    INV.HQ
    INV.LGB