Dictionary/3000 Reference Manual (32244-90001)
Chapter 3 29
Using the DICTDBM Commands
Using Commands to Define a Database
Creating Elements and Files for a Database
An element or a file must be defined in the Dictionary before it can be associated or related
to another entry. The CREATE command is used to define an entry for a data element or a
file.
Either the command string CREATE ELEMENT or CREATE FILE is used to create the
entry in the Dictionary. The name for the element or the file must be unique. Use the
REPEAT option before the command string to create definitions for more than one element
or file without having to repeat the command. An entry for the BASE file must be created
later to establish the hierarchical relationship between the data sets and the database.
If you are defining an IMAGE database, the IMAGE/3000 rules for defining a master data
set and a detail data set apply. For example, if the data set is a detail set, you must
indicate which data elements are the search items, the name of the master set each search
item is related to, the data set's capacity and so forth.
After the entries are created, they may be displayed by the LIST or DISPLAY commands.
If you want to delete the entry, use the PURGE command. If you want to change the entry,
use the MODIFY command or the RENAME command.
The RELATE ELEMENT command string can be used to define CHILD elements (fields)
within a PARENT data element. This allows access to parts of a larger data element. For
example, in the case of an IMAGE database which contains a compound data item, CHILD
elements can be used to provide access to the sub-items of the compound item. To do so,
respond to the BYTE POSITION prompt by specifying the starting location of the sub-item
within the compound item.
Relating Data Sets to a BASE File
The hierarchical relationship between the data sets and the BASE file is established with
the RELATE command. The command string RELATE FILE is used to define this
relationship. This command allows for more than one data set to be related to a BASE file
during the command cycle. If relationships for more than one database are to be
established, use the REPEAT option with the command string.
Relationship entries can be displayed by using the SHOW command. All the data sets and,
optionally, all the data elements associated with the set, are displayed for a BASE file. For
a data set, the elements directly associated with it are displayed. The elements are
displayed in the physical order of their association with the file. The SHOW command
indicates key elements with an asterisk, identifies the chain paths, and much more. The
REPORT command displays an alphabetical list of the elements associated with a data
set, or an alphabetized schema-type listing of elements for a database file.
You can delete the relationship entry with the REMOVE command and change the entry
with the CHANGE command. The REORDER command is used to change the physical
order in which the files are related to the BASE file.