HP 3000 Manuals

Dictionary Data Maintenance Commands [ HP SYSTEM DICTIONARY XL SDMAIN ] MPE/iX 5.0 Documentation


HP SYSTEM DICTIONARY XL SDMAIN

Dictionary Data Maintenance Commands 

Once you have run SDMAIN, opened the dictionary, and defined the
environment, you can then begin entering and updating dictionary data.
To do this, however, you must open the dictionary with a scope that
grants you the scope rights that you need.  For example, if you need to
use versions, you must have a scope that grants version capability.  (See
the HP System Dictionary/XL General Reference Manual, Volume 1 
(32256-90004) for a discussion of scope rights.)

In addition, you must open the dictionary in either shared-update or
exclusive-update open mode.  These are the only two modes in which you
are allowed to enter and modify data, manage security (create scopes,
etc.), use version capability, and use the domain feature.

You cannot modify a compiled dictionary.  If you specify any of the
dictionary data maintenance commands with a compiled dictionary, System
Dictionary issues an error message.  Table 3-4 lists the data maintenance
commands and their subcommands.  The specific syntax for each of these
commands is shown in Chapter 4, "System Dictionary Commands."

          Table 3-4.  Dictionary Data Maintenance Commands and Subcommands 

--------------------------------------------------------------------------------------------
|                           |                                                              |
|          COMMAND          |                         SUBCOMMAND *                         |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| ADD                       | SCOPE-DOMAIN | SCOPE-ENTITY | SCOPE-RELATIONSHIP             |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| COPY                      | ENTITY | RELATIONSHIP | VERSION                              |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| CREATE                    | DOMAIN | ENTITY | RELATIONSHIP | SCOPE | SYNONYM | VERSION   |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| DELETE                    | DOMAIN | ENTITY | RELATIONSHIP | SCOPE | SYNONYM | VERSION   |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| EDIT                      | ENTITY | RELATIONSHIP                                        |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| MODIFY                    | DOMAIN | ENTITY | RELATIONSHIP | SCOPE | VERSION |           |
|                           | SCOPE-ENTITY | SCOPE-RELATIONSHIP                            |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| REMOVE                    | SCOPE-DOMAIN | SCOPE-ENTITY | SCOPE-RELATIONSHIP             |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| RENAME                    | DOMAIN | ENTITY | SCOPE | VERSION                            |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| RENUMBER                  | :                                                            |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| RESEQUENCE                |                                                              |
|                           |                                                              |
--------------------------------------------------------------------------------------------
|                           |                                                              |
| SETVERSION                |                                                              |
|                           |                                                              |
--------------------------------------------------------------------------------------------

* Where | means OR

The following is a list of the dictionary data maintenance commands and a
description of each.

ADD              Associates domains, entities, and relationships to a
                 security scope and specifies the access rights of the
                 scope to the added entities and relationships.

COPY             Creates a new entity (or version) and copies the source
                 object's attributes and relationships (and entities) to
                 the new entity (or version).

CREATE           Creates new entities, relationships, synonyms, scopes,
                 versions, and domains.

DELETE           Deletes entities, relationships, synonyms, scopes,
                 versions, and domains.

EDIT             Edits variable length attribute text belonging to
                 entities and relationships.

MODIFY           Modifies entities, relationships, scopes,
                 scope-entities, scope-relationships, versions, and
                 domains.

REMOVE           Removes domains, entities, and relationships from a
                 scope.  The opposite of the ADD command.

RENAME           Renames entities, scopes, versions, and domains.

RENUMBER         Assigns new numbers to the relationship position
                 attribute of the relationships of a relationship type.

RESEQUENCE       Changes the order of relationships.  Resequences the
                 relationships of a relationship type.

SETVERSION       Sets a version to one of three statuses:  test,
                 production, or archival.

Data Creation 

Before you actually begin creating and manipulating dictionary data, you
should be familiar with the core set and the various entity types,
relationship types, etc., that are available.  (Refer to the HP System 
Dictionary/XL General Reference Manual, Volume 1 (32256-90004) for a
complete description of the core set.)  Once you have done this, you are
then ready to begin creating those entities and relationships that you
need in your dictionary.

One important aspect of data creation is the creation of entity names.
Refer to the HP System Dictionary/XL General Reference Manual, Volume 1 
(32256-90004) for discussions on entity naming, aliases, and synonyms.

Data Maintenance 

After you have created entities, relationships, scopes, versions, etc.,
you can modify or delete them using dictionary commands such as DELETE,
EDIT, MODIFY, RENAME, etc.

The dictionary must be open in exclusive-update mode in order to delete,
modify, or rename scopes, domains, and versions.

Example 

The example below shows the logical sequence of data creation, data
association, and data maintenance using many of the available data
maintenance commands listed in table Table 3-4.

>DEFINE DICTIONARY = sysdic;                        Opens the dictionary.

>>SCOPE = dictionary-administrator; 

>>PASSWORD = da; 

>>OPEN-MODE = shared-update; 

>>DOMAIN = domain1; 

>>STATUS = test. 

>CREATE SCOPE personnel;                            Creates a new security scope
                                                    called personnel, with secure,
>>SCOPE-RIGHTS = s,c,v;                             create, and version capabilities,
                                                    and with p as the password.
>>PASSWORD = p. 

>CREATE DOMAIN personnel-domain;                    Creates a new domain called
                                                    personnel-domain with a new
>>VERSION = testversion; COMMON = version1.         version called testversion linked
                                                    to the common version version1.

>DEFINE                                             Reopens SYSDIC (which is the
                                                    default if no dictionary is
>>SCOPE = personnel;                                specified) with the new scope,
                                                    version, and domain that have just
>>PASSWORD = p;                                     been created.

>>OPEN-MODE = exclusive-update; 

>>VERSION = testversion; 

>>DOMAIN = personnel-domain. 

>CREATE ENTITY employee-record;                     Creates a new entity called
                                                    employee-record of entity-type
>>ENTITY-TYPE = record;                             record.

>>ATTRIBUTE-LIST = (byte-length = 55, 

>>DESCRIPTION="This record 

>>contains employee data"). 

>CREATE ENTITY last-name;                           Creates new entities called
                                                    last-name, first-name, date-hired,
>>ENTITY-TYPE = element;                            and social-security-no of
                                                    entity-type element.
>>ATTRIBUTE-LIST = (element-type = X, 

>>BYTE-LENGTH = 10, 

>>COBOL-ALIAS = emp-last-name). 

>CREATE ENTITY first-name; 

>>ENTITY-TYPE = element; 

>>ATTRIBUTE-LIST = (element-type = X, 

>>BYTE-LENGTH = 20, 

>>COBOL-ALIAS = emp-first-name). 

>CREATE ENTITY date-hired; 

>>ENTITY-TYPE = element; 

>>ATTRIBUTE-LIST = (element-type = 9, 

>>BYTE-LENGTH = 6, 

>>BLANK = yes, 

>>DESCRIPTION = "date in mmddyy format"). 

>CREATE ENTITY social-security-no; 

>>ENTITY-TYPE = element; 

>>ATTRIBUTE-LIST = (element-type = 9, 

>>BYTE-LENGTH = 9, 

>>COBOL-ALIAS = emp-ss-no). 

>CREATE RELATIONSHIP employee-record, last-name;    Creates relationships of type
                                                    record contains element by 
>>RELATIONSHIP-TYPE = record, element;              relating last-name, first-name,
                                                    date-hired, and
>>RELATIONSHIP-CLASS = contains.                    social-security-no, to 
                                                    employee-record.

>CREATE RELATIONSHIP employee-record, first-name; 

>>RELATIONSHIP-TYPE = record, element; 

>>RELATIONSHIP-CLASS = contains. 

>CREATE RELATIONSHIP employee-record, date-hired; 

>>RELATIONSHIP-TYPE = record, element; 

>>RELATIONSHIP-CLASS = contains. 

>CREATE RELATIONSHIP employee-record, 

>>social-security-no; 

>>RELATIONSHIP-TYPE = record, element; 

>>RELATIONSHIP-CLASS = contains. 
>MODIFY ENTITY last-name; ENTITY-TYPE = element;    Modifies attribute byte-length for
                                                    entity last-name.
>>ATTRIBUTE-LIST = (BYTE-LENGTH = 20). 

>CREATE SYNONYM surname; ENTITY-TYPE = element;     Creates a synonym called surname 
                                                    for element last-name.
>>ENTITY = last-name. 

>RESEQUENCE employee-record, social-security-no;    Resequences the order of elements
                                                    in the relationship record 
>>RELATIONSHIP-TYPE = record, element;              contains element by putting
                                                    social-security-no before
>>RELATIONSHIP-CLASS = contains;                    last-name.

>>BEFORE-ENTITY = last-name. 

>RENAME VERSION testversion,V00-00.                 Renames the version from
                                                    testversion to V00-00.

>SETVERSION V00-00; status = production.            Sets the version V00-00 to
                                                    production status.

>EXIT.                                              Terminates the program.



MPE/iX 5.0 Documentation