USING COMMANDS TO DEFINE HP INFORM 3000 GROUPS [ DICTIONARY 3000 ] MPE/iX 5.0 Documentation
DICTIONARY 3000
USING COMMANDS TO DEFINE HP INFORM/3000 GROUPS
The Dictionary must be properly set up in order to produce the desired
reports using HP Inform/3000. Usually this is the responsibility of the
Database Administrator (DBA). HP Inform/3000 enables the user to define
and create reports from data contained in IMAGE databases, MPE files, and
KSAM files. (For specific information on how to run HP Inform/3000 and
produce reports, see the HP Inform/3000 User's Guide.)
HP Inform/3000 makes the distinction between two methods of organizing
data: databases and HP Inform/3000 groups. In order for a user to
define a report, HP Inform/3000 presents a Data Organization Menu from
which one of these two methods must be selected. Which method is
appropriate depends on whether the data elements can all be found in one
data set, or whether they have been organized into groups.
HP Inform/3000 Groups
HP Inform/3000 groups are logical groupings of data elements which have
been defined in the Dictionary. Before defining HP Inform/3000 groups,
the DBA needs to gather and organize all the information required by all
the HP Inform/3000 users. For example, some users will want to produce
marketing reports, some manufacturing reports, others personnel reports,
etc. The groups can be defined according to these identified categories
of information which have logically connected data elements - "data
names" as they are called in HP Inform/3000.
By organizing data elements into groups, the DBA is taking advantage of
HP Inform/3000's ability to access elements from multiple and different
types of data files. Elements can be accessed from more than one data
set. KSAM and MPE files can also be accessed. In addition, an element
can be assigned an alias name which is especially meaningful to the HP
Inform/3000 user. This name will then appear on HP Inform/3000's Data
Names Menu.
A hierarchical relationship between groups is established by using the
RELATE command (refer to Section IV of this manual for a description of
this command). This relationship is summarized in Figure 3-5. It is
reflected in the hierarchy of HP Inform/3000 Group Menus and Subgroup
Menus as seen by the HP Inform/3000 user.
___________________________________________________________________________
| |
| |
| |
| $MENU <---- PARENT group |
| --------|-------- |
| | | |
| | | |
| PARENT/CHILD |
| group ----> GROUP ... GROUP <---- CHILD group|
| / \ | |
| / \ | |
| / \ data |
| / \ elements |
| / \ |
| CHILD |
| group --->GROUP GROUP ... <---- PARENT/CHILD group |
| | | |
| | | |
| data GROUP <---- CHILD group |
| elements |
| | |
| | |
| data |
| elements |
| |
___________________________________________________________________________
Figure 3-5. Summary of Hierarchical Structure for Groups
$MENU is the top of the structure and is the PARENT group. Other groups
are related to $MENU and are CHILD groups. A CHILD group can in turn be
a PARENT group of other CHILD groups (which are called "subgroups" in HP
Inform/3000 and appear on HP Inform/3000's Subgroup Menu). This
hierarchical relationship can exist up to 10 levels deep, starting with
$MENU. A PARENT group cannot have data elements associated with it. Note
that $MENU is created automatically when the Dictionary is initialized
and cannot be altered or purged.
Each group in this hierarchy must be defined in the Dictionary. The data
elements you wish to associate with a group and the files those data
elements are associated with must first be defined in the Dictionary.
Preceding topics in this section provide the details for defining
databases and other file structures. The following description outlines
the steps involved when you use the DICTDBM commands to define groups. A
complete description for all the commands is given in Section IV of this
manual.
Creating Elements and Groups
To create data elements and group entries, use the CREATE command. The
CREATE ELEMENT or CREATE GROUP command string is used to define the
entry. An element or group must be defined in your Dictionary before you
can associate or relate it to other entries. The name entered for the
element or group must be unique among elements and groups, respectively.
The remaining prompts allow the user to provide useful information, but
are not required. You can create many elements or groups in a command
cycle by using the REPEAT option.
After creating entries in the Dictionary, you can use the LIST or DISPLAY
commands. If you want to delete an entry, use the PURGE command. To
change an entry, use either the MODIFY or RENAME commands.
The RELATE ELEMENT command string can be used to define CHILD elements
(fields) within a PARENT data element. Note, however, that to report on
a CHILD data element from HP Inform/3000, that data element must have
been added to the group (the PARENT element may or may not be in the
group).
Relating Groups to a Group
The hierarchical relationship between groups is established with the
RELATE command. Use the command string RELATE GROUP to define this
relationship. When relating groups to the top of the hierarchical
structure, enter $MENU in response to the prompt for PARENT GROUP; in
response to CHILD GROUP, enter the name of the group to be related to
$MENU. The groups related to $MENU will all appear on HP Inform/3000's
Group Menu.
A relationship for other levels is defined in a similar manner - by
entering the name of the higher level group for PARENT GROUP, and the
lower level group for CHILD GROUP. If the PARENT group is not $MENU, the
CHILD groups related to that PARENT group will appear on an HP
Inform/3000 Subgroup Menu.
The DESCRIPTION prompt allows you to supply useful information but is not
required to define the relationship.
The relationship between groups can be displayed by using the SHOW
command. For a PARENT group, this command displays each CHILD group, if
any, and the data elements associated with each CHILD. For a CHILD group,
the data elements associated with it are displayed. The elements are
displayed in the actual order they were associated with the group.
The REPORT command can be used to display an alphabetical listing of the
elements associated with a group or with related CHILD groups.
You can delete the relationship entry by using the REMOVE command and can
change the entry by using the CHANGE command. The REORDER command is
used to change the actual order in which the CHILD groups are related to
the PARENT groups.
Example
>RELATE GROUP
PARENT GROUP> $menu <
CHILD GROUP> marketing <
DESCRIPTION>
CHILD GROUP> shipping <
DESCRIPTION>
CHILD GROUP> personnel <
DESCRIPTION>
CHILD GROUP> <
Adding Elements to Groups
The ADD GROUP command string associates data elements with previously
created groups. The data element must already exist in the data
Dictionary. The Dictionary will prevent you from associating elements
with a PARENT group by issuing an error message and reissuing the prompt
for GROUP. (Note that an element need not be associated with a file at
the time the ADD GROUP command string is executed; however, the element
must have been added to a file before HP Inform/3000 is executed.)
In response to the prompt for ELEMENT, enter the name of the data
element. Responding to the ELEMENT ALIAS prompt is optional. HP
Inform/3000 uses the element alias name in its Data Names Menu; if no
element alias is given, the data element name (primary name) is used.
Note that this element alias name should be meaningful to the HP
Inform/3000 user since it will appear on HP Inform/3000's Data Names
Menu. It may or may not be the same as the element alias name specified
when the element is added to a file.
NOTE The element alias name is only used by HP Inform/3000 on its Data
Names Menu. The data element name (primary name) will be used as
the report heading for that element unless a heading has been
specified in response to the HEADING TEXT prompt of the CREATE
ELEMENT command string. In addition, the data element name
(primary name) will be used in HP Inform/3000's "SELECTION CRITERIA
FOR data name(s)" prompt unless you have responded to the ENTRY
TEXT prompt of the CREATE ELEMENT command string. If you wish this
to match the element alias name, you must specify the element alias
name as the HEADING TEXT and the ENTRY TEXT on the CREATE ELEMENT
command string.
The prompt for FILE allows you to designate the name of the specific file
which should be used to retrieve the values of an element when a report
is being created from this group. For example, the data element "date"
may be the date a product was purchased in one file, and the date the
product was shipped in another file. Thus it is important to specify
from which file you want the values for "date" to be taken. This would
apply even if the data element "date" had been given different alias
names when it was added to the different files. (This particular
situation could be avoided if two separate data elements, such as
"pur-date" and "ship-date" , are created in the Dictionary and added to
the appropriate file.) Note that when a file name is specified in
response to the FILE prompt, the element must already be associated with
that file.
If, on the other hand, it is not important which file is used (for
example, suppose the data element "soc-sec-no" existed in more than one
file), it is better not to respond to the FILE prompt. This allows HP
Inform/3000 to retrieve the values in a more efficient manner.
If a file specified in response to FILE is an IMAGE data set with more
than one PARENT file (BASE), the prompt PARENT FILE is issued next and
must be answered.
The next prompt, VALUE AS A LINK, can be used to specify which elements
should be selected to link the desired elements into a logical record for
reporting:
* If each of the elements being associated with a group can link all
the files, do not respond to the VALUE AS A LINK prompt for any of
them.
* If only one of the elements can link all the files, then give it a
high priority link value (1) and let the link values of the others
default (0). * If more than one element is needed to link the files,
give a link value of 1 to the one that should be tried first, 2 to
the one that should be tried next, and so on. Use -1 if you never
want the element to be used as a link and 0 (the default) if the
element could be used if needed.
NOTE An element can link two files only if it exists in both files and
if certain additional requirements, depending on the file being
linked to, are met. See Appendix D, How HP Inform/3000 Links Files
to Generate Reports, for more information on linking.
Elements assigned a positive link value form a prioritized list to be
used when it is necessary to link files. The lower the positive integer
assigned to an element, the higher the likelihood that it will be used as
a link. In general, you should assign a link value of 1 to the element
that will link the most files containing elements for the group, 2 to the
element that will link the next most, and so on. This will ensure that
the reports an HP Inform/3000 user requests from a particular group will
be generated efficiently.
Table 3-1 summarizes the priorities of the possible link values:
Table 3-1. Link Value Priorities
--------------------------------------------------------------------------------------------
| | |
| LINK VALUE | PRIORITY |
| | |
--------------------------------------------------------------------------------------------
| | |
| 1 | Highest priority |
| | |
| 2 | Next highest priority after link value of 1 |
| | |
| 3 | Next highest priority after link values 1 and 2. |
| | |
| . | . |
| | |
| . | . |
| | |
| n | Next highest priority after link values 1, 2, ...n-1 |
| | |
| -1 | Never used as a link |
| | |
--------------------------------------------------------------------------------------------
Note that if an element has different meanings in different files (for
example, the data element "date" may have different meanings in different
files), you will not want it to be used as a link even if it links all
the files containing elements for the group. Give such a data element
("date" ) a link value of -1. (Note that in this case, simply answering
the FILE prompt, without specifying a link value of -1, will cause the
correct values for "date" to be printed in the report but will not help
to link the files correctly.)
By both responding to the FILE prompt for an element and assigning a
positive link value to the element, you are designating a potential
"driving file" . The driving file is the file that is accessed first.
Since at least one line of the report will be generated for each record
retrieved from the driving file, the contents of a report could be quite
different if the driving file is different. By designating a potential
driving file, you are specifying that file should be accessed first
whenever:
* any element from the group which exists in that file is requested for
the report, and
* no other potential driving file has been designated which has a
higher priority link value specified and contains an element
requested for the report.
Hence, if you respond to the FILE prompt and designate a link value of 1
for a particular element, the specified file will be accessed first
whenever any element which exists in that file is requested in a report.
If you respond to the FILE prompt and designate a link value of 2 for
another element, the file specified in response to this FILE prompt will
be accessed first whenever any element which exists in that file is
requested in a report and no element which exists in the first file is
requested.
NOTE The linking process determines whether it is possible to generate
the requested report and, if so, what specific data will be printed
in the report. For more information about linking, link values,
and driving files, see Appendix D of this manual, How HP
Inform/3000 Links Files to Generate Reports.
The DISPLAY ELEMENT ON MENU prompt allows the user to determine whether
an element is to be displayed on HP Inform/3000's Data Names Menu and
used when generating reports. By not displaying an element on the menu,
you can include an element in the group for linking and not allow it to
be used for reporting.
Note that a CHILD data element can not be used in linking files. CHILD
elements can, however, be requested in an HP Inform/3000 report as long
as they have been added to the group; the PARENT element alone in the
group is not sufficient. If a data element which is a CHILD is needed
for a report, HP Inform/3000 will try to find the PARENT element. Since
a CHILD element could have more than one PARENT, it will first use a
PARENT that has been added to the group. If no PARENT of the CHILD
element exists in the group, HP Inform/3000 tries to find any PARENT of
the CHILD element it can find. In order to ensure that the correct CHILD
element is retrieved, you should add the PARENT element to the group (in
addition to the CHILD element); if you do not wish users to report on the
PARENT element, add it to the group and respond "NO" to the DISPLAY
ELEMENT ON MENU prompt. (You may also wish to specify a link value of
-1, if you do not want the PARENT element to be used to link files.) HP
Inform/3000 retrieves the value of the entire PARENT element, but only
displays the value of the appropriate CHILD element in the report.
You can display association entries by using the REPORT or SHOW commands.
To delete the association, use the DELETE command; to change it use the
UPDATE command. The order in which the elements are associated with the
group are the order they will appear on HP Inform/3000's Data Names Menu;
this can be changed by using the RESEQUENCE command. Example
>ADD GROUP
GROUP> marketing <
ELEMENT> name <
ELEMENT ALIAS> employee name <
FILE> ! <
ELEMENT> date <
ELEMENT ALIAS> date of hire <
FILE> empfile <
VALUE AS A LINK> <
DISPLAY ELEMENT ON MENU (Y/N)?n
DESCRIPTION>
ELEMENT> <
MPE/iX 5.0 Documentation