HP RPG/XL Programmer's Guide (30318-90001)
3- 37
that permits read access to the database.
4 This line defines the data set to be used.
Columns 54-65 contain DSNAMED-ACCOUNTS to identify the data set,
D-ACCOUNTS.
5 This line begins the input record description of the DACCOUNT
file.
6 This line begins the output record description of the DISPLAY
file.
Reading a TurboIMAGE Data Set Sequentially By Key. This section explains
how to read all records in a detail data set having a specific key value.
This method is useful when a data set contains records with duplicate
keys. Unlike KSAM files, you cannot read a TurboIMAGE data set
sequentially by a range of key values (reading sequentially within key
limits).
The program in Figure 3-26 finds and displays all records in the data
set, D-ACCOUNTS, having the same last name. The last name field
(NAME-LAST) is defined as a key in the data set (see the schema for the
data set in Figure 3-23). A user enters a last name from a terminal.
When the last name does not exist, one of two warning messages (NO SUCH
NAME or END OF CHAIN) is displayed.