IBM AS/400 Manuel D’Utilisation

Page de 489
 
 
Database Physical File
 
Chapter 19. Example of an Interactive Application
This chapter illustrates some common workstation applications and their ILE RPG
coding.
The application program presented in this chapter consists of four modules. Each
module illustrates a common use for WORKSTN files. The first module (CUSMAIN)
provides the main menu for the program. Based on the user
'
s selection, it calls the
procedure in the appropriate module which provides the function requested.
Each module uses a WORKSTN file to prompt the user for input and display infor-
mation on the screen. Each module, except for the main module CUSMAIN, also
uses a logical file which presents a 
view of the master database file. This view
consists of only the fields of the master file which the module requires for its proc-
essing.
Note:  Each module, except CUSMAIN, can be compiled as a free standing
program, that is, they can each be used as an independent program.
Table  29.  Description of Each Module in the Interactive Application Example
Module
Description
“Main Menu Inquiry” on
page  346
An example of a basic menu inquiry program that
uses a WORKSTN file to display menu choices
and accept input.
“File Maintenance” on page 349
An example of a maintenance program which
allows customer records in a master file to be
updated, deleted, added, and displayed.
“Search by Zip Code” on
page  358
An example program which uses WORKSTN
subfile processing to display all matched records
for a specified zip code.
“Search and Inquiry by Name”
on page 364
An example program which uses WORKSTN
subfile processing to display all matched records
for a specified customer name, and then allows the
user to select a record from the subfile to display
the complete customer information.
Database Physical File
Figure 169 on page 346 shows the data description specifications (DDS) for the
master customer file. This file contains important information for each customer,
such as name, address, account balance, and customer number. Every module
which requires customer information uses this database file (or a logical view of it).
 Copyright IBM Corp. 1994, 1999 
 
345