Control items are maintained by the system. User programs can access control items, but cannot modify them. Although programs cannot directly alter control items, certain requests to the Enterprise Database Server can cause them to be modified.
The following types of control items are maintained by the system:
<control items>
![]() |
──┬─<aggregate items>─────────────────┬───────────────────────────────┤ ├─<count items>─────────────────────┤ ├─<population items>────────────────┤ ├─<record type items> ──────────────┤ ├─<restart data set control items>──┤ └─<data set control items>──────────┘ |
Each control item type is described in the following text.
Aggregate Items
An aggregate item is a count or sum maintained by the Enterprise Database Server that is based on data items in a data set. An aggregate item is updated during ENDTRANSACTION processing, which avoids a requirement to lock global data during a transaction, and also keeps other jobs from seeing partially updated information before the transaction is committed.
For embedded structures, the aggregate items are declared in the master structure. The value is updated immediately after an embedded record is stored or deleted. This is because the population or aggregate information for embedded structures is based on the master record instead of the embedded structure itself. For every master record, the population item contains the total of embedded records belonging to this master. There is no need to hold the value until ENDTRANSACTION. However, to maintain the consistency and integrity of the database when aggregate items are declared, the INDEPENDENTTRANS, LOCK TO MODIFY DETAILS, and REAPPLYCOMPLETED options are required.
The following diagrams illustrate the syntax for an aggregate item:
<aggregate item>
──<aggregate item name>─┬───────────┬─ AGGREGATE ──────────────────────► └─<comment>─┘ ►─<size specification>──<aggregate type>───────────────────────────────┤
<size specification>
── ( ─┬─────┬─<precision>─┬─────────────────────┬─ ) ──────────────────┤ └─ S ─┘ └─ , ──<scale factor>─┘
<aggregate type>
──┬─ SUM ── ( ──<arithmetic expression>── ) ─┬─ OF ──<data set name>───┤ └─ COUNT ── ( ──<Boolean expression>── ) ──┘
The following table explains the elements of the syntax diagrams:
Example
The following example illustrates the use of aggregate items:
D1 DATA SET ( D1-ID1 NUMBER(10); D1-ID2 ALPHA(10); D1-ID3 NUMBER(5); D1-ID4 NUMBER(2); ); G1 AGGREGATE (S12) SUM (D1-ID1 + D1-ID3 - D1-ID4) OF D1; G2 AGGREGATE (4) COUNT (D1-ID2 NEQ "ABC") OF D1;
Count Items
Count items are used with counted links. Any data set that is referenced by a counted link must contain one count item. A count item contains a binary integer value that indicates the number of counted links which refer to the record. The system automatically adjusts the value in the count item to reflect the number of links that currently reference the record. Records that contain a nonzero count value cannot be deleted. Any program that attempts to delete such a record receives an exception and the deletion is not performed. User programs can examine the value of a count item, but cannot modify it.
Each data set can have a maximum of one count item. Count items cannot be used as keys.
The following diagram illustrates the syntax for count items:
<count item>
──<count item name>─┬───────────┬─ COUNT ( <unsigned integer> ) ───────┤ └─<comment>─┘
Example
The following DASDL data set declarations include counted items:
D DATA SET ( L IS IN E COUNTED; A ALPHA(3); ); E DATA SET ( C COUNT (10); N NUMBER(5); );
Population Items
Population items provide a user-accessible count of the records in a data set, set, or subset. The system automatically adjusts the value of population items as records are added and deleted. User programs can examine the value of a population item, but cannot modify it.
Only one population item can be declared for each data set, set, or subset. Population items for disjoint structures are declared with global data. Population items for embedded structures must reside in the master record for the structure.
A data set declaration population item, unlike the data set physical options or set-subset physical options population items, does not limit the population or affect the physical attributes of the data set, set, or subset.
The following diagram illustrates the syntax for a data set population item:
<population item>
──<population item name>─┬───────────┬─────────────────────────────────► └─<comment>─┘ ►─ POPULATION ( <unsigned integer> ) OF ─┬─<data set name>─┬───────────┤ ├─<set name>──────┤ └─<subset name>───┘
The following table explains the elements of the syntax diagram:
Example
The following example illustrates the use of the data set population item:
POP-D POPULATION (1000) OF D; D DATA SET ( POP-S POPULATION (100) OF S; A ALPHA(3); E DATA SET ( R REAL; F FIELD(20); ); S SET OF E KEY IS F; );
Record Type Items
A data set can contain at most one record type item. A record type item declared in the fixed-format part of a record accomplishes two things. It signals the DASDL compiler that a variable-format record is being described, and it causes a record type item to be allocated.
A variable-format record consists of two parts: a fixed part and a variable part. A single record description exists for the fixed part. The variable-format part can describe several variable parts, each of which is identified by a unique integer label. An individual record is constructed by using the fixed part alone or by joining the fixed part with one of the variable parts.
When a host language program creates a new variable-format record, it supplies an integer value indicating the type of record being created. This integer must match one of the integer labels associated with a variable part or it must be zero (0). A zero (0) indicates that the record contains the fixed part only. This integer value is automatically stored in the record type item. When a record is retrieved from the database, the record type can be tested to determine the type of variable-format record found.
The following diagram illustrates the syntax for declaring record type items:
<record type item>
──<record type item name>─┬───────────┬────────────────────────────────► └─<comment>─┘ ►─┬─ RECORD TYPE ─┬─ ( <unsigned integer> ) ───────────────────────────┤ └─ TYPE ────────┘
The following table describes the elements of the syntax diagram:
Example
The following example illustrates the use of record type items. A value of 0 (zero) in T indicates that the record consists of the fixed part alone. Type 0 (zero) records contain items T and A only. When T contains the value 1, the record contains items T, A, A1, and N1. Similarly, if T contains the value 2, the record contains items T, A, R2, A2, and B2.
D DATA SET ( T RECORD TYPE(2); A ALPHA(3) REQUIRED; ), 1: ( A1 ALPHA(12); N1 NUMBER(6); ), 2: ( R2 REAL; A2 ALPHA(35); B2 BOOLEAN; );
Restart Data Set Control Items
![]() |
The first word of every restart data set record is a TRANSACTION COUNT item, which provides a count of the number of times the program has been in transaction state. The counter is initialized to 0 (zero) and incremented at ENDTRANSACTION time after the restart area has been saved in the audit trail. |
The first digit of the second word of every restart data set record contains a RESTART TYPE item that identifies the value of the restart record. The RESTART TYPE item occupies two digits, but only the first is used. For information about valid values and descriptions for the RESTART TYPE item, refer to Structure Formats.
The TRANSACTION COUNT and RESTART TYPE items are present in every restart data set record regardless of whether they are explicitly declared. If the items are declared, they are read-only items, and their contents cannot be modified. For a user program to access these items, they must be explicitly declared in the DASDL description.
The following table lists the updates and reorganizations required for certain operations involving the TRANSACTION COUNT item, the RESTART TYPE item, or both:
Operation |
Required Update or Reorganization |
---|---|
Addition or deletion from the restart data set record description |
A DASDL update, a control file update, a DMSUPPORT library recompilation, and a reorganization of the restart data set |
Use of the RESTART TYPE item as a key item in a set (the item becomes an implicitly required item) |
A reorganization of the restart data set (location change of the first required item in the data set) |
Deletion from the restart data set specification in DASDL |
A modification and recompilation of programs that refer to the deleted item (thus avoiding a version error) |
The following diagram illustrates the syntax for declaring restart data set control items:
<restart data set control items>
──<restart data set control item name>─┬───────────┬─────────────────► └─<comment>─┘ ►─┬─TRANSACTION COUNT──┬───────────────────────────────────────────────┤ └ RESTART TYPE ──────┘
Example
The following example declares the TRANSACTION COUNT and RESTART TYPE control items in a restart data set.
RDS RESTART DATA SET (TC TRANSACTION COUNT; RT RESTART TYPE; R-DATA ALPHA (20); );
Data Set Control Items
RSN Item
The RSN is a unique, ever‑increasing number with the following characteristics:
-
The RSN exists within the scope of the data set, taking up one word in the record.
-
The system increments the RSN whenever a record is created in the data set.
-
If a record is deleted, the system does not reuse the RSN value of the deleted record.
-
The RSN can be used to uniquely identify a record within the data set.
-
Internally, the system uses the RSN as a tie breaker for sets and subsets that have the DUPLICATES option set.
-
The RSN item is present in every XE data set record regardless of whether it is explicitly declared.
-
If the item is declared, the RSN item is a read‑only item, and its contents cannot be modified.
-
If a user program is to access the RSN or to use it as a key item in a set or subset, the RSN item must be explicitly declared in the DASDL description.
The following table lists the updates and reorganizations required for certain operations involving the RSN item:
Operation |
Required Update or Reorganization |
---|---|
Addition or deletion from the data set record description |
A DASDL update, a control file update, and a DMSUPPORT library recompilation A modification and recompilation of programs that refer to the deleted item (thus avoiding a version error) |
Use of the RSN item as a key item in a set (the item becomes an implicitly required item) |
A reorganization of the data set (location change of the first required item in the data set) |
You cannot access or declare the TRANSTAMP word. The system uses this word for more efficient record locking within the XE structures. The TRANSTAMP word is the basis for removing the 50,000 locked record limit for the database. Although there is no create or lock limit for XE structures per transaction, if a transaction involving the creation of many records (approximately 200,000 or more) aborts, the SINGLEABORT operation might fail. If the SINGLEABORT operation fails, a halt/load recovery will successfully recover the database.
The following diagram illustrates the syntax for declaring data set control items:
<data set control items>
──<data set control item name>─────────┬───────────┬───────────────────► └─<comment>─┘ ►─┬─RECORD SERIAL NUMBER──┬─────────────────────────────────────────────┤ └ RSN ──────────────────┘
Example
The following example uses an RSN item, RSN-I.
D DATA SET (A Alpha (10); RSN-I RSN; );