Creating the Data File

Creating a data file is easy. D3 files are created by specifying size in terms of frames, or groups. This file size is known as the primary file space, and it is a contiguous section of data on the disk. The size of the file is known as the modulo, and it should always be a prime number.

To create a data file, the command syntax is:

create-file filename dict-modulo data-modulo

 

filename

Is the (combination dictionary and data sections) name of the data file and should easily identify the contents of the file, such as customers, purchase order codes, inventory, and so on. Filenames can be up to 48 characters long.

dict-modulo

Is the size of the dictionary section in frames, as a prime number integer and is the number of frames to use in creating the dictionary section of the file. Since each frame is 2000 bytes, it is necessary to know how many bytes are used to store all the attribute-defining items for this file. Typical attribute-defining items use from 50 to 200 characters apiece. In this case, each frame holds about ten to 40 attribute-defining items.

data-modulo

Is the size of the data section in frames, as a prime number integer and is the number of frames to use in creating the data section of the file. Since each frame is 2000 bytes, it is necessary to know how many attributes are stored per item, the average number of characters of each attribute, and how many items are stored.

NOTE—The prime {number} command can be used to calculate the nearest prime number to your estimated figure.

To create the most efficiently-sized file:

Specifying the proper file size exactly is not as critical as it seems. D3 has a routine called resize that examines a file, determines proper file size, and automatically resizes the file.

To create attribute-defining items:

Create attribute-defining items that define the contents of each attribute.

To modify the file-defining item:

Once all the attribute-defining items are created, modify the file-defining item:

To create indexes:

Now that the file is created and the attributes are defined, create the indexes for the attributes with:

create-index filename a-code

To enter data:

The setup is now ready for data entry. Invoke the Update Processor by entering:

U filename {item-ID}

See Also

Creating a Database in D3

Sample Database Design and Creation