Technical data

000100 PROCEDURE DIVISION
.
.
.
000500 FIND LAST PART.
000510 FIND FIRST SUPPLY WITHIN PART_INFO.
000520 FIND NEXT WITHIN PART_INFO.
000530 FIND FIRST VENDOR.
.
.
.
Statement 000500 sets the last occurrence of PART (TAPE) as current of record
type PART. Statement 000510 sets the SUPPLY record occurrence (2-DAYS) as
current of record type SUPPLY. Statement 000520 updates current of record type
for SUPPLY to record occurrence (1-WEEK). Statement 000530 sets VENDOR
record occurrence (MUSICO INC.) as current of record type VENDOR.
5.13.4 Current of Run Unit
The Database Control System (DBCS) updates the currency indicator for current
of run unit each time a run unit refers to a different record occurrence, regardless
of realm, set, or record type. For example:
000100 PROCEDURE DIVISION.
.
.
.
000500 FIND FIRST PART.
000510 FIND FIRST SUPPLY.
000520 FIND FIRST VENDOR.
000600 .
000610 .
000620 .
Statement 000500 sets the current of run unit to the first PART record occurrence
(LABEL). Statement 000510 then sets the first SUPPLY record occurrence (4-
DAYS) as current of run unit. Finally, statement 000520 sets the first VENDOR
record (MUSICO INC.) as current of run unit. The first VENDOR record
occurrence remains current of run unit until the run unit refers to another record
occurrence.
5.14 Currency Indicators in an HP COBOL DML Program
Currency indicators are the tools you use to navigate through a database.
Because of the many set relationships a database can contain, touching a record
with a DML statement often changes more than one currency indicator. For
example, a FETCH to a set type record can change currency for the set type, the
record type, the realm, and the run unit. Knowing currency indicator status,
how currency indicators change, and what statements control them, will help you
locate the correct data.
Example 5–3 searches for TAPE vendors with a supply rating equal to A. Assume
that record TAPE resides in BUY realm and that the SUPPLY record occurrences
2-DAYS and 5-DAYS have a SUP_RATING equal to A. Figure 5–28 shows how
DML statements affect currency status.
5–28 Database Programming with HP COBOL