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

5- 7
6 This line defines the WEIGHT field in the ORDER file. This
field will be used as the search field to find the correct
postal rate in the WGHRATE table.
7 This line specifies a LOKUP operation which searches the WGHRATE
table to find the postal rate corresponding to each item's
weight.
Columns 10-11 contain 02 to specify that this operation is
performed when indicator 02 is turned on (assume that indicator
02 is turned on when an item requires postal delivery).
Columns 18-27 contain WEIGHT to specify the search field.
Columns 28-32 contain LOKUP to specify the table look-up
operation.
Columns 33-42 contain TABWGT to specify the table field to be
searched.
Columns 43-48 contain TABRAT to specify the table field to be
selected when WEIGHT is equal to or less than TABWGT.
Columns 56-59 contain 2323 to specify that indicator 23 is
turned on when a weight is found in TABWGT equal to or less than
WEIGHT.
8 This line defines the INVOICE record that prints the postal rate
found by a successful search of the WGHRATE table. The rate
table name, TABRAT, selects the element in the table (not the
entire table) found by the last LOKUP operation.
Execution-Time Arrays. Execution-time arrays are loaded from files named
in File Description and File Extension Specifications. They can also be
created by Calculation Specifications. There are no execution-time
tables.
Figure 5-5 lists a program that uses an execution-time array, AR. This
program is an online program that lets users query an employee master
file by department number. When the department number is found, the last
name of each employee in the department is saved in the AR array. When
the array is filled with ten names, they are displayed on the terminal.