HP System Dictionary [ HP ALLBASE/BRW Reference Manual ] MPE/iX 5.0 Documentation
HP ALLBASE/BRW Reference Manual
HP System Dictionary
The following programs are used to set up HP System Dictionary:
SDINIT The System Dictionary initialization utility. For
each dictionary you want, run this program to
create an empty dictionary.
SDDBD Run this program to load the IMAGE database root
file. SDDBD loads the data dictionary with the
element and dataset definitions of an IMAGE
database.
SDMAIN The System Dictionary program used to create,
maintain, and report entries. Since SDDBD loads
only an extract from the database's root file, you
must also run the program SDMAIN to define the
search element components; define the number of
decimal places for numeric elements; define MPE and
KSAM files; and add date and time items.
SDCONV This System Dictionary utility program converts HP
Dictionary/3000 definitions to HP System
Dictionary.
Refer to the following books for details about how to use the System
Dictionary:
* HP System Dictionary/XL General Reference Manual volumes 1 and 2
* HP System Dictionary/XL Utilities Reference Manual
* HP System Dictionary/XL SDMAIN Reference Manual
Extensions to HP System Dictionary
The System Dictionary contains a number of predefined entity types,
relationship types, relationship classes, and attributes, known as the
core set. These structures are created when the dictionary is
initialized. HP ALLBASE/BRW supports two extensions to the HP System
Dictionary Core Set:
* UNIQUE
* ELEMENT-SUBTYPE
UNIQUE.
You can add the extra attribute, UNIQUE, to the following Core Set
relationship type.
IMAGE-DATASET
ELEMENT
IMAGE-DATASET
IMAGE-DATABASE
chains
If you assign the attribute UNIQUE to this relationship, it will indicate
that all the SEARCH-ELEMENT chains in a detail dataset have length of 1.
That is, there is only one element in each chain. This saves you having
to read for the end-of-chain marker for SEARCH-ELEMENT chains with only
one element.
ELEMENT-SUBTYPE attributes.
You can add an extra attribute, ELEMENT-SUBTYPE, wherever you can use the
attribute ELEMENT-TYPE. ELEMENT-SUBTYPE is used to identify date and time
item types.
To add these extensions to your dictionary
1. Add a scope name and scope password to the DEFINE statement at the
beginning of the BRWSDEXT file. The scope must have extent
capability (for example, your DASCOPE) so it can add the
extensions to your system dictionary when the file is opened.
2. Use the file BRWSDEXT as the command input file when running
SDMAIN. For example:
:FILE SDIN = BRWSDEXT.PUB.SYS
:RUN SDMAIN.PUB.SYS
NOTE If you do not add the scope password to the BRWSDEXT file, then
SDMAIN will prompt for it at run time.
Terminology
The terminology in HP System Dictionary and HP ALLBASE/BRW is not always
the same. The table below shows the difference in terminology in these
two products:
-------------------------------------------------------------------------------------------
| |
| HP ALLBASE/BRW HP System Dictionary |
| |
-------------------------------------------------------------------------------------------
| |
| Item (Entity-type) ELEMENT |
| |
| Format One of the following relationship types: |
| |
| |
| IMAGE-DATASET contains RECORD |
| |
| FILE contains RECORD |
| |
| KSAMFILE contains RECORD (the above can be linked with the |
| relationship type: |
| |
| RECORD contains ELEMENT) |
| |
| File Entities of type FILE |
| with attribute file-type = SEQUENTIAL or RELATIVE |
| |
| KSAM File Entities of type KSAMFILE |
| with attribute ksamfile-type = DATA |
| |
| Dataset Entities of type IMAGE-DATASET |
| with attribute image-dataset-type = DETAIL, MANUAL, or AUTOMATIC |
| |
| Database Entities of type IMAGE-DATABASE |
| with attribute image-database-type = IMAGE or TURBO |
| |
-------------------------------------------------------------------------------------------
In this section the terminology used is that of HP System Dictionary.
For example, the term element is used instead of item. However, date and
time items are called items, since date and time items are HP ALLBASE/BRW
constructions.
Items/Elements
Items are defined as entities of type ELEMENT in HP System Dictionary.
When defining the element name in HP System Dictionary, follow these
rules:
* Use a maximum of 20 characters for the element name; however, only
use a maximum of 16 characters if the report is to run with HP
BRW/V. (HP System Dictionary allows 32 characters.)
* Use a letter as the first character of the element name.
* Do not include spaces, dots, commas and paren theses in the
element name.
Element Alias Names
Define alias names for existing elements whose names conflict with the
above rules. Whenever possible, HP ALLBASE/BRW uses alias names for
elements. HP ALLBASE/BRW uses the image-alias for elements in
image-datasets and the standard-alias for elements in MPE and KSAM files.
HP ALLBASE/BRW uses the following logic when looking for alias names:
* The alias is taken from the RECORD contains ELEMENT relationship
or the ELEMENT contains ELEMENT relationship.
* If no alias is found above, HP ALLBASE/BRW takes the alias from
the ELEMENT definition.
* If no alias is found above, HP ALLBASE/BRW takes the primary name
of the element.
Finding an Element's Attributes
HP ALLBASE/BRW uses the attribute back-reference-flag when looking for an
element's attributes. If the back-reference-flag is FALSE, HP
ALLBASE/BRW takes the attributes from the RECORD contains ELEMENT
relationship or the ELEMENT contains ELEMENT relationship. If the
back-reference-flag is TRUE, HP ALLBASE/BRW takes the attributes from the
ELEMENT definition.
HP ALLBASE/BRW supports the following element data types:
HP ALLBASE/BRW supports the following element data types:
-------------------------------------------------------------------------------------------
| |
| Strings Maximum length of 255 characters |
| |
| Numeric elements Maximum of 13 integer digits and 6 decimal places |
| |
| Packed numeric elements Maximum of 13 integer digits and 6 decimal places, with |
| Trailing Overpunch or No Sign |
| |
| Zoned numeric elements Maximum of 13 in teger digits and 6 decimal places, with |
| Trailing Overpunch or No Sign |
| |
| 16-Bit integers |
| |
| 32-Bit integers |
| |
| 64-Bit integers (type N in HP ALLBASE/BRW) |
| |
| Integers with decimals (type N in HP ALLBASE/BRW) |
| |
| 32-Bit and 64-Bit real numbers Real numbers can be either HP 3000 or IEEE format. You |
| can (optionally) tell HP ALLBASE/BRW which format a Real |
| number element is stored in by adding the |
| ELEMENT-SUBTYPE HP 3000 or IEEE to that element. |
| |
| If there is no ELEMENT-SUBTYPE, HP ALLBASE/BRW assumes |
| Real numbers in TurboIMAGE databases are HP 3000 real |
| numbers, and real numbers in MPE and KSAM files are IEEE |
| real numbers. |
| |
| HP Business BASIC This type converts to fixed-point numeric in HP |
| floating-point decimal (D) ALLBASE/BRW. Note that the range of numeric numbers is + |
| or - 9(13).9(6). If a type D number overflows, it will |
| be set to OVERFLOW; if it underflows it will be set to |
| zero. |
| |
-------------------------------------------------------------------------------------------
The next table illustrates the HP System Dictionary element types, and
how they are handled by HP ALLBASE/BRW. A number suffix equals the number
of words. For example I2 equals a 2-word (4-byte) integer.
System Dictionary Element Types
-----------------------------------------------------------------------------
| | | | |
| Dictionary | Decimals | BRW Type | Remarks |
| Element Type | | | |
| | | | |
-----------------------------------------------------------------------------
| | | | |
| I, I2, J, J2, | 0 | I (integer) | |
| K, K2 | | | |
| | | | |
- -
| | | | |
| I, I2, J, J2, | > 0 | N (numeric) | |
| K, K2 | | | |
| | | | |
- -
| | | | |
| I4, J4, K4 | | N (numeric) | |
| | | | |
- -
| | | | |
| P, Z, 9, Z+, | | N (numeric) | Maximum 13 integer digits |
| D, P+ | | | and 6 decimals |
| | | | |
-----------------------------------------------------------------------------
| | | | |
| Z (SIGN ' ' or | | N (numeric) | Trailing Overpunch assumed |
| sign = 'TO') | | | |
| | | | |
-----------------------------------------------------------------------------
| | | | |
| Z (sign = 'TS' | | R (real) | |
| 'LS' or 'LO') | | | |
| | | | |
| R2, R4, E2, E4 | | R (real) | |
| | | | |
- -
| | | | |
| U, X | | S (string) | Maximum length 255 bytes |
| | | | |
- -
| | | | |
| X, 9, I, J, K | | D (date) | ELEMENT-SUBTYPE is a date |
| | | | |
- -
| | | | |
| X, 9, I, J, K | | T (time) | ELEMENT-SUBTYPE is a time |
| | | | |
- -
| | | | |
| B, S, * | | Not | Not Supported |
| | | Supported | |
| | | | |
-----------------------------------------------------------------------------
HP ALLBASE/BRW supports both parent and child elements. The relationship
ELEMENT contains ELEMENT establishes a child element that is part of a
parent element. You can use either the child elements alone, or the
child elements and the parent element. If several parent elements have
the same child element, HP ALLBASE/BRW treats all occurrences of that
child element in a dataset or file as synonyms, that is, as the same
element.
ELEMENT-SUBTYPE attributes
Elements to be used as date or time items in HP ALLBASE/BRW are defined
in HP System Dictionary using the extra attribute ELEMENT-SUBTYPE. You
can add an ELEMENT-SUBTYPE attribute to the entity ELEMENT, the
relationship RECORD contains ELEMENT, and the relationship ELEMENT
contains ELEMENT. To use ELEMENT-SUBTYPE, you must first extend your
system dictionary using the file BRWSDEXT.PUB.SYS, as described earlier.
You can only use ELEMENT-SUBTYPEs when the element-type of the element
is X, 9, I, J, or K. (But note that you can optionally add an
ELEMENT-SUBTYPE to real numbers to tell HP ALLBASE/BRW in which format
(HP 3000 or IEEE) the real number is held).
System Dictionary DATE-ITEM Table
(DISPLAY and INTEGER Format)
-------------------------------------------------------------------------------------------
| |
| System Dictionary Length Required Element Type Example: |
| ELEMENT-SUBTYPE (1 word = 16 bits) (Date is 04/28/92) |
| |
-------------------------------------------------------------------------------------------
| |
| DMY-D 8 Bytes X 28/04/92 |
| |
| DMYY-D 10 Bytes X 28/04/1992 |
| |
| MDY-D 8 Bytes X 04/28/92 |
| |
| MDYY-D 10 Bytes X 04/28/1992 |
| |
| YMD-D 8 Bytes X 92/04/28 |
| |
| YYMD-D 10 Bytes X 1992/04/28 |
| |
| DDY-D 6 Bytes X 118/92 |
| |
| DDYY-D 8 Bytes X 118/1992 |
| |
| YDD-D 6 Bytes X 92/118 |
| |
| YYDD-D 8 Bytes X 1992/118 |
| |
-------------------------------------------------------------------------------------------
| |
| DM-D 5 Bytes X 28/04 |
| |
| MD-D 5 Bytes X 04/28 |
| |
| MY-D 5 Bytes X 04/92 |
| |
| MYY-D 7 Bytes X 04/1992 |
| |
| YM-D 5 Bytes X 92/04 |
| |
-------------------------------------------------------------------------------------------
| |
| DMY 3 Words I, J, or K |
| |
| DMYY 3 Words i, J, or K |
| |
| MDY 3 Words I, J, or K |
| |
| MDYY 3 Words I, J, or K |
| |
| YMD 3 Words I, J, or K |
| |
| YYMD 3 Words I, J, or K |
| |
| DDY 2 Words I, J, or K |
| |
| DDYY 2 Words I, J, or K |
| |
| YDD 2 Words I, J, or K |
| |
| YYDD 2 Words I, J, or K |
| |
-------------------------------------------------------------------------------------------
Table 18-0. System Dictionary DATE-ITEM Table
(DISPLAY and INTEGER Format) (cont.)
-------------------------------------------------------------------------------------------
| |
| System Dictionary Length Required Element Type Example: |
| ELEMENT-SUBTYPE (1 word = 16 bits) (Date is 04/28/92) |
| |
-------------------------------------------------------------------------------------------
| |
| DM 2 Words I, J, or K |
| |
| MD 2 Words I, J, or K |
| |
| DD 1 Word I, J, or K |
| |
| MY 2 Words I, J, or K |
| |
| MYY 2 Words I, J, or K |
| |
| YM 2 Words I, J, or K |
| |
| YYM 2 Words I, J, or K |
| |
-------------------------------------------------------------------------------------------
| |
| CALENDAR 2 Bytes I, J, or K |
| |
| JULIAN 4 Bytes I, J, or K |
| |
-------------------------------------------------------------------------------------------
System Dictionary DATE-ITEM Table
(NUMERIC and ALPHANUMERIC Format)
-------------------------------------------------------------------------------------------
| |
| System Dictionary Length Required Element Type Example: |
| ELEMENT-SUBTYPE (1 word = 16 bits) (Date is 04/28/92) |
| |
-------------------------------------------------------------------------------------------
| |
| DMY 6 Bytes X or 9 280492 |
| |
| DMYY 8 Bytes X or 9 28041992 |
| |
| MDY 6 Bytes X or 9 042892 |
| |
| MDYY 8 Bytes X or 9 04281992 |
| |
| YMD 6 Bytes X or 9 920428 |
| |
| YYMD 8 Bytes X or 9 19920428 |
| |
| DDY 5 Bytes X or 9 11892 |
| |
| DDYY 7 Bytes X or 9 1181992 |
| |
| YDD 5 Bytes X or 9 92118 |
| |
| YYDD 7 Bytes X or 9 1992118 |
| |
-------------------------------------------------------------------------------------------
| |
| DM 4 Bytes X or 9 2804 |
| |
| MD 4 Bytes X or 9 0428 |
| |
| DD 3 Bytes X or 9 118 |
| |
| MY 4 Bytes X or 9 0492 |
| |
| MYY 6 Bytes X or 9 041992 |
| |
| YM 4 Bytes X or 9 9204 |
| |
| YYM 6 Bytes X or 9 199204 |
| |
-------------------------------------------------------------------------------------------
System Dictionary TIME-ITEM Table (All Formats)
-------------------------------------------------------------------------------------------
| |
| System Dictionary Length Required Element Type Example: |
| ELEMENT-SUBTYPE (Time is 15:43:24) |
| |
-------------------------------------------------------------------------------------------
| |
| HM24 4 Bytes X or 9 1543 |
| |
| HMS24 6 Bytes X or 9 154324 |
| |
| HM12 5 Bytes X 0343P |
| |
-------------------------------------------------------------------------------------------
| |
| HM24-D 5 Bytes X 15:43 |
| |
| HMS24-D 8 Bytes X 15:43:24 |
| |
| HM12-D 6 Bytes X 03:43P |
| |
-------------------------------------------------------------------------------------------
| |
| HM24 2 Words I, J, or K |
| |
| HMS24 2 Words I, J, or K |
| |
-------------------------------------------------------------------------------------------
| |
| CLOCK 4 Bytes I, J, or K |
| |
-------------------------------------------------------------------------------------------
Notes: Notes for the previous tables:
* The EXAMPLE column shows how the date and time are held.
There is no EXAMPLE for integers because they are held as
16-bit words.
* When held as integers, date or time item types have the
same ELEMENT-SUBTYPE attributes as when held in numeric or
alphanumeric form (X or 9). However, the base type must
be an integer (I, J, or K).
* Where no year is held, (for example, in date item DM), the
year is assumed to be the current year. HP ALLBASE/BRW
adds the current year when the date is accessed.
* Where only the last two digits of the year are held (for
example, in date item DMY), the century is assumed to be
1900. This is also the case for item CALEND.
* Where no day is held (for example, in date item MY), the
day is assumed to be the first of the month.
* Where the day is held as DD (for example, in date item
DDY), the date is held as the number of days from the
start of the year (January 1st). The example date is
04/28/87, that is the 118th day of 1987.
* There is no hyphen in the ELEMENT-SUBTYPE name for the
item HMS24D. (This is because the maximum length of an
ELEMENT-SUBTYPE name is 6 characters).
* All items whose length is expressed in WORDS must be
defined as an array of 2-byte integers. For example, to
enter a 3-word integer Date Item (such as YYMD), run
SDMAIN and enter:
BYTE-LENGTH = 2 COUNT = 3
The BYTE-LENGTH is always 2 and the COUNT is 1, 2, or 3
depending on the number of words. (The above item is
actually held as 3 * 16-bit integers).
* A JULIAN date is a 4-byte integer. The Julian date is
calculated using the CACM Algorithm 199.
* CALEND and CLOCK are in the format returned by the
corresponding HP 3000 Intrinsics. They must be defined as
2- and 4-byte integers respectively.
Keys
HP ALLBASE/BRW finds key information in the following ways:
* For master datasets: HP ALLBASE/BRW takes the key from the
relationship IMAGE-DATASET key ELEMENT.
* For detail datasets: HP ALLBASE/BRW takes the key from the
relationship:
IMAGE-DATASET
ELEMENT
IMAGE-DATASET
IMAGE-DATABASE
chains
* For KSAM files: HP ALLBASE/BRW takes the key from the
relationship KSAMFILE key ELEMENT.
HP ALLBASE/BRW supports the extra attribute UNIQUE for the last two
relationships. Use the attribute UNIQUE to indicate that all
search-element chains have length 1 (second relationship), or that
duplicate key entries are not allowed (third relationship).
NOTE BRWDIC is not capable of holding database-specific key information.
For example: a detail data set is a member of two databases and
each database has a different search path to its copy of the data
set. This is illustrated in the two chains relationships below.
detailset search-element1 sort-element master1 base1
detailset search-element2 sort-element master2 base2
HP ALLBASE/BRW will allow you to specify any of the two
search-elements as a key in either database; it will not restrict
the use of search-element2 to base2.
Datasets
Datasets are defined as entities of type IMAGE- DATASET with attribute
image-dataset-type = DETAIL, AUTOMATIC, or MANUAL. Elements that are
related to the first primary record (or, if no primary record exists,
elements that are related to the first record) become the elements of the
dataset.
When specifying an IMAGE-DATASET name, follow these rules:
* The file name must be the real name of the IMAGE dataset.
* Do not include spaces, points, commas and parentheses in the file
name.
The relationship IMAGE-DATASET contains RECORD describes which elements
are in the dataset. Search elements can also be defined using the
relationship IMAGE-DATASET key ELEMENT.
The relationship ELEMENT contains ELEMENT describes the components of a
composite search element. The composite search element becomes a parent
element, and the components become its child elements.
If several composite search elements have the same child element, HP
ALLBASE/BRW treats all occurrences of that child element as synonyms, in
other words, as the same element.
If no ELEMENT-SUBTYPE is supplied, HP ALLBASE/BRW assumes that a real
number contained in an IMAGE dataset is in HP 3000 format.
Databases
Databases are defined as entities of type IMAGE- DATABASE, where the
entity name must be the name of the database without group and account.
The relationship IMAGE-DATABASE contains IMAGE-DATASET describes which
datasets are in the database.
MPE Files
MPE files (sequential or relative) are defined as entities of type FILE,
where the filename must be the file format name in the data dictionary
without group and account. The relationship FILE contains RECORD
describes which elements are in the MPE file.
HP ALLBASE/BRW only supports MPE files with fixed length records.
Elements that are related to the first primary record (or, if no primary
record exists, elements that are related to the first record) become the
elements of the file.
If no ELEMENT-SUBTYPE is supplied, HP ALLBASE/BRW assumes that a real
number contained in an MPE file is in IEEE format.
KSAM Files
KSAM files are defined as entities of type KSAMFILE, where the file name
must be the file format name in the data dictionary without group and
account. The relationship KSAMFILE contains RECORD describes the record
format for the KSAM file.
HP ALLBASE/BRW only supports KSAM files with fixed-length records.
Elements that are related to the first primary record (or, if no primary
record exists, elements that are related to the first record) become the
elements of the KSAM file.
If no ELEMENT-SUBTYPE is supplied, HP ALLBASE/BRW assumes that a real
number contained in a KSAM file is in IEEE format.
Using Byte-offsets
RSYSDIC cannot compute the offset of either an element within a record or
an element within a group element (that is, within a RECORD contains
ELEMENT relationship or an ELEMENT contains ELEMENT relationship). This
is because the logon-scope might not have access to all elements in that
relationship. You must therefore always take the offset of any element
within such a relationship from the value of the byte-offset attribute
associated with the relationship.
For example, a record contains 6 elements, and you want to find the
position of the third element in the record. If your logon-scope has
access to all the elements in the record, you can find the size of the
first two elements, and therefore the start of the third element. If
your logon-scope does not have access to either of the first two
elements, you will have to find the start of the third element from the
byte-offset attribute associated with the RECORD contains ELEMENT
relationship that links the third element to the record.
(If the byte-offset attribute = 0, (the default byte-offset), the element
is placed directly after the last element in the record. Therefore, if
you do not assign a byte-offset in SDMAIN, all the elements in a record
will take the default byte-offset attribute of 0, and will be placed one
after the other.)
Defining Overlays
You can use the byte-offset attribute to define overlays of elements.
(HP ALLBASE/BRW does not support the relationship ELEMENT redefines
ELEMENT). For example: an element part-number consists of 3 letters and
3 digits (ABC123, QWE080 etc), and the 3 digits tell you the weight of
the part.
You can set up two relationships:
part-record contains part-number; element-type= X;
length= 6; byte-offset= 1
part-record contains part-weight; element-type= 9;
length= 3; byte-offset= 4
The element part-weight will overlay the numeric half of part-number, and
you can use part-weight in calculations.
Preparing a BRWDIC Dictionary File With HP System Dictionary
BRWSD prepares a BRWDIC dictionary file from an HP System Dictionary-type
dictionary file.
To create BRWDIC with the System Dictionary
1. Run BRWSD:
:RUN BRWSD.PUB.SYS
2. Respond to these prompts. A description of the choices follows
these steps.
External Scope Name:
Scope Password: not displayed
Domain: default is the common domain
Version: if unknown, omit
Version Status: only appears if version is omitted
choose P(roduction), T(est), or A(rchive)
Include Parent Elements (N/Y)?
Use Names up to 20 Characters (Y/N)?
If you press Return at the External Scope Name prompt, the program will
terminate.
Description of choices.
The default for Version Status is Production.
If you want to include parent elements in the BRWDIC, answer Y to the
prompt Include parent elements (N/Y)? If you choose to include parent
elements, they appear with their associated child elements on the Project
Items screen and can be used in relations.
If you do not include parent elements, you can subsequently only use a
parent element in a relation by specifying a separate relation for each
of its child elements. The default is to NOT include parent elements.
If you want to use names in the BRWDIC, which can be up to 20 characters
long, answer Y to the prompt Use Names up to 20 Characters (Y/N)? If you
want to use only names with maximum length 16 characters, answer N to the
prompt. In this case, names longer than 16 characters will be truncated
and a check will be made to ensure that the truncated names are still
unique. If you want reports to run with BRW/V, answer N. The default is
to support names up to 20 characters.
BRWSD opens the HP System Dictionary with the logical name SYSDIC, and
creates the BRWDIC file with the logical name BRWDIC.PUB. If you want to
use file equations on either of these files, remember to use the logical
names.
If the program encounters an end of file in the dictionary file, you can
increase the file size of the dictionary file by entering a FILE command,
as shown here:
:FILE BRWDIC.PUB; DISC=5000
Then, run the BRWSD program again.
Warning Messages
The program sends a warning message if one of these invalid definitions
for HP ALLBASE/BRW occurs:
* invalid element type
* invalid syntax in the format name
* more than 18 decimals
* format without elements
These messages do not prevent the program from creating the BRWDIC file.
MPE/iX 5.0 Documentation