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 information 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 processing.
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 1. Description of Each Module in the Interactive Application Example
Module Description
Main Menu Inquiry An example of a basic menu inquiry program that uses a WORKSTN file to display menu choices and accept input.
File Maintenance 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 An example program which uses WORKSTN subfile processing to display all matched records for a specified zip code.
Search and Inquiry by Name 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.