HP RPG/XL Programmer's Guide (30318-90001)

3- 19
Comments
1 This line defines the KSAM file, MASTFL.
Column 17 is E to specify that processing proceed to the end of
the file.
Column 32 contains C to indicate the file that the file be
processed in chronological order.
Updating a KSAM Disc File
This section shows how to randomly update a KSAM file using its primary
key.
Figure 3-17 lists a program that updates a customer master file (MASTFL)
for a large department store. The master file is updated by a daily
sales transaction file (TRANSFL). Each sales transaction contains an
identification code that is used to access the customer's record in the
customer master file. Each transaction also contains the amount charged
by the customer. This amount is used to update the customer's account
balance.
.
Figure 3-17. Updating a KSAM File Randomly by Primary Key