Technical data
5.13.2 Current of Set Type
Each set type currency indicator can be null or it can identify:
• A record and its position in the set type
• A position in the set type but not a record
A record identified by a set type currency indicator is the current record for the
set type, or current of set type.
If the ordering criterion for a set type is NEXT or PRIOR, the set type’s currency
indicator specifies the insertion point for member records. Therefore, if the
currency indicator points to an empty position, a member record can be inserted
in the specified position. If the currency indicator points to a record and NEXT
is specified, a member record can be inserted after the current record for the
set type. If the currency indicator points to a record and PRIOR is specified, a
member record can be inserted before the current record for the set type.
The DBCS updates current of set type only when you reference a record that
participates either as an owner or member in a set type occurrence. For example:
000100 PROCEDURE DIVISION.
.
.
.
000500 FIND FIRST PART.
000510 FIND FIRST SUPPLY WITHIN PART_INFO.
000520 FIND OWNER WITHIN VENDOR_SUPPLY.
000600 .
.
.
Statement 000500 sets the first occurrence of PART (LABEL) as current of set
types PART_USES, PART_USED_ON, and PART_INFO. This is because PART
records participate in three sets (see Figure 5–2). Because LABEL is current of
PART_INFO, statement 000510 sets the first occurrence of SUPPLY (4-DAYS)
owned by LABEL as current of set type PART_INFO. Because SUPPLY also
participates in the VENDOR_SUPPLY set, this statement also sets the current
occurrence of SUPPLY as current of set type VENDOR_SUPPLY. Statement
000520 sets the VENDOR owner record occurrence (SOUND-OFF CO.), which
owns the current SUPPLY record, as current of set type VENDOR_SUPPLY.
5.13.3 Current of Record Type
Each record type currency indicator can be null or it can identify:
• A record and its position among other records of the same type
• A position among records of the same type, but not identify a record
Record type currency indicators do not identify a record type’s relationship with
other record types.
A record identified by a record type currency indicator is called current of record
type. The DBCS updates the current of record type only when you reference a
different record occurrence of the record type. References to other record types do
not affect this currency. For example:
Database Programming with HP COBOL 5–27