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

4-: 75
regular RSI files. Therefore, you cannot use the indicators in the
normal way to condition Calculation Specification operations.
If the user presses a command key not associated with any record type,
the message "FORM CHANGE OR EXIT NOT ACCEPTABLE" is displayed
momentarily.
A Sample Program Using an RSI CONSOLE File. This section lists a
complete program that uses RSI CONSOLE files to read and balance
invoices. Each invoice can have three or more records, where each record
belongs to a different record type (the record types are sequenced).
Each invoice must have a header record that gives the customer name and
address, one or more detail records that list individual items on the
invoice and a summary record that gives the total invoice amount. The
user enters data for the header, detail an summary records in that order.
Each group of invoice records are written to disc along with any errors.
When the program is executed, the first form (FORM01) is displayed. When
the user finishes entering data on the form and presses ENTER , the
second form (FORM02) is displayed. When ENTER is pressed again, the
second form is redisplayed because it can occur more than once in a
group. The user can continue entering detail records or can select the
third form by pressing command key 3 (the record-identifying indicator
for the last record type). When input is complete for FORM03, the user
presses ENTER and the first form is displayed again, starting the
sequence over. The user presses command key 12 to end the program.
Figure 4-40. Invoice-Balancing Program that Uses an RSI CONSOLE File