RENUMBER [ HP SYSTEM DICTIONARY XL SDMAIN ] MPE/iX 5.0 Documentation
HP SYSTEM DICTIONARY XL SDMAIN
RENUMBER
Renumbers the relationships of a relationship type.
Syntax
RENU[*ER] parent-entity-name
;R[ELATIONSHIP-]T[YPE] = entity-type-name1
,entity-type-name2
[,entity-type-name3]
[,entity-type-name4]
[,entity-type-name5]
[,entity-type-name6]
[;R[ELATIONSHIP-]C[LASS] = relation-class-name]
[;S[TART-]POS[ITION] = start-rel-position]
[;INC[REMENT] = position-increment]
.
Parameters
parent-entity-name Name of the parent entity of the relationships to
be renumbered. For example, if the type and class
of the relationship to be renumbered is FILE
contains RECORD, the parent-entity-name is the name
of the FILE.
entity-type-name(N) Name of the entity type involved in the
relationship type.
relation-class-name Name of the relationship class.
start-rel-position The relationship-position to be assigned to the
first relationship in the list. The default is
1000.
position-increment The amount that the relationship-position attribute
is incremented for each subsequent relationship.
The default is 1000.
Description
Renumber allows you to assign values with equal intervals between them to
the relationship-position attribute of relationships. You can do your
own renumbering by modifying the relationship-position attribute value
through the MODIFY RELATIONSHIP command.
You need to use the RENUMBER command when you want to create a
relationship and have it ordered between two existing relationships whose
relationship-position attribute values are consecutive.
For example, a COBOL program has the following record layout:
01 SALES-DATA.
05 ACCOUNT PIC S9(9) COMP.
05 QUANTITY PIC S9(4) COMP.
05 PURCH-DATE PIC X(6).
To define the record layout, the following relationships
of the relationship type RECORD contains ELEMENT exist in the
dictionary: sales-data contains account with byte-offset of 1 and
relationship-position of 1, sales-data contains quantity with byte-offset
of 5 and relationship-position of 2, and sales-data contains purch-date
with byte-offset of 7 and relationship-position of 3.
The program changes to have the following record layout:
01 SALES-DATA.
05 ACCOUNT PIC S9(9) COMP.
05 QUANTITY PIC S9(4) COMP.
05 PRICE PIC S9(9) COMP.
05 PURCH-DATE PIC X(6).
To redefine the record layout, you need to modify the relationship
sales-data contains purch-date to have a byte-offset of 11. You also
want to create the relationship sales-data contains price and have it
ordered between relationships sales-data contains quantity and sales-data
contains purch-date. The relationships would have to be renumbered since
sales-data contains price needs its relationship-position value to be
between 2 and 3 which is impossible. You can renumber the relationships
by specifying a START-POSITION of 10 and an INCREMENT of 10. This
assigns relationship-position values of 10, 20, and 30 to the
relationships sales-data contains account, sales-data contains quantity,
and sales-data contains purch-date, respectively. Now you can create the
new relationship sales-data contains price and assign its byte-offset to
7 and its relationship-position to a value between 20 and 30. The
relationships now define the new record layout.
Open Mode: Shared-update or exclusive-update
Scope: DA scope or any scope with create capability and modify
access to all the relationships with the specified
parent entity
Example
The following example renumbers all the relationships of relationship
type record contains element whose parent entity is sales-data starting
with 10 and increasing by increments of 10.
>RENUMBER sales-data;
>>RELATIONSHIP-TYPE = record, element;
>>RELATIONSHIP-CLASS = contains;
>>START-POSITION = 10;
>>INCREMENT = 10.
>
MPE/iX 5.0 Documentation