Sei sulla pagina 1di 8

Chapter

An introduction to interactive programs

For years, batch processing was the rule in the data processing industry. However, with the development of data communications facilities and display stations, interactive processing has become more and more common. In fact, most applications that are developed today are interactive. In an interactive (or on-line) system, a user working at a display station interacts with the computer. On a transaction-by-transaction basis, the user enters data and receives output back from the system. There's no longer a need to batch transactions, then process them all at once. This chapter describes four types of interactive programs you're likely to encounter, as well as four considerations common to all types of interactive systems, IMS or otherwise.

Types of interactive programs The kinds of programs you can find on interactive systems fall into four main categories: (1) inquiry programs, (2) data entry programs, (3) maintenance programs, and (4) menu programs. Although some interactive programs may combine functions and, as a result, fall into two or more of these groups, these are the basic categories.

An introduction

to interactive

programs

1
Terminal Inquiry program

Explanation 1. 2. 3. The operator requests the data to be displayed. The program retrieves the appropriate base. data from the data

The program displays the data at the terminal.

Figure 1-1

An inquiry program

Inquiry programs An inquiry program is designed to respond to a user's question. Almost always, that means an inquiry program has to retrieve data stored on the computer system. Figure 1-1 illustrates a typical inquiry program. As you can see, the inquiry program here requires three steps: (1) the operator enters some value to identify the data to be retrieved, such as a segment key; (2) the program retrieves the appropriate segments from a data base; and (3) the program displays the data at the terminal. Figure 1-2 shows three screens from a typical inquiry program. This program displays information for a selected invoice from a customer data base. In the first screen (part 1), the terminal is waiting for the operator to enter an invoice number. The second screen (part 2-) shows the invoice number the operator entered. When the operator presses the enter key, the program retrieves and displays the data for the specified invoice (part 3). The inquiry program figure 1-2 presents is simple; it accesses just one data base and, for each transaction, just one data base segment. However, it's possible to develop complex inquiry programs that provide a variety of display options and that combine data extracted from several DLiI data bases. Even so, figures 1-1 and 1-2 represent the basic operation of an inquiry program.

Data entry programs

Although inquiry programs are widely used, they don't let users key in data that's added to a system's data bases. For

10

Chapter 1

The invoice inquiry program awaits operator input

DISPLAY INVOICE:

INVOICE

SUMMARY DATE: SUBTOTAL: DISCOUNT: SAlES TAX: FREIGHT: BILLING: PMTS/ADJS: DUE:

DATE:

01/23/87

Figure 1-2

Operation of an inquiry program (part 1 of 3)

The operator enters an invoice number

DISPLAY INVOICE:

INVOICE

SUMMARY DATE: SUBTOTAL: DISCOUNT: SALES TAX: FREIGHT: BILLING: PMTS/ADJS: DUE:

DATE:

01/23/87

.Q.10000

Figure 1-2

Operation of an inquiry program (part 2 of 3)

An introduction to interactive programs

11

The program retrieves the specified

invoice segment and displays data from it

DISPLAY INVOICE:

INVOICE 010000

SUMMARY DATE: 07/15/86 SUBTOTAL: DISCOUNT: SAlES TAX: FREIGHT: BI lUNG: PMTS/ADJS: DUE: 200.00 0.00 0.00 13.00 213.00 0.00 213.00

DATE:

01/23/87

Figure 1-2

Operation of an inquiry program (part 3 of 3)

that, data entry programs are used. Figure 1-3 illustrates a simple data entry program that requires only two steps. First, the operator enters data for one transaction at the terminal, and then the program updates any related data bases. Frankly, this is as simple as a data entry program can be. More sophisticated programs involve interaction with the operator, requiring him to verify the data he entered by comparing it with information the program extracted from data bases. Still other data entry programs integrate inquiry and data entry functions. Maintenance programs A maintenance program can update a data base by adding, replacing, or deleting segments. Figure 1-4 shows a typical maintenance program. In this case, the program allows only changes to existing segment occurrences. In step 1, the operator enters a key value to identify the data to be changed. Then, the program extracts the necessary information from the data base (step 2), and displays it for the operator to review (step 3). The operator enters the changes that need to be made to the data (step 4), and the program issues the necessary calls to record the changes in the data base (step 5).

12

Chapter 1

Terminal

Data entry program

Data base

Explanation 1. 2. The operator enters the data for one transaction terminal. The program updates any related data bases. at the

Figure 1-3

A data entry program

2 Maintenance program 5 Data base

3
4

Explanation 1. 2. 3. 4. 5. Figure 1-4 The operator requests the data to be updated. The program retrieves the appropriate base. data from the data

The program displays the data at the terminal. The operator enters the required changes to the data. The program rewrites the changes to the data base.

A maintenance program

You can think of a maintenance program as a combination of an inquiry program and a data entry program. Like an inquiry program, a maintenance program accepts a key value and retrieves data for display. And like a data entry program, a maintenance program accepts data the operator keys in and uses it to update the appropriate data bases.

An introduction

to interactive

programs

13

Program 1

Menu program

Program 2

Program n

Explanation 1. 2. 3. Figure 1-5 The menu program sends a Iist of selections to the terminal. The operator chooses one of the selections. Control is transferred to the appropriate program.

A menu program

Menu programs A menu program lets an operator select the functions he wants to perform. Figure 1-5 shows a typical menu program. Three steps are required: (1) the program sends a list of processing selections to the terminal; (2) the operator chooses one of the selections; and (3) the menu program passes control to the program the operator selected. An application that's built around a set of menu programs is called a menu-driven system. Figure 1-6 shows a typical menu screen. In many interactive systems, several layers of menus are required. For example, if the operator selects number 1 in figure 1-6, another menu showing selections related to order entry might be displayed. Some interactive systems don't use menus. Instead, the operator invokes programs using explicit commands. For example, the operator might enter
DISPINV

14

Chapter

MASTER

MENU

1. 2. 3. 4.

ORDER CUSTOMER CUSTOMER

ENTRY MAINTENANCE INQUIRY

INVOICING

YOUR

SELECTION:

PRESS

CLEAR

TO

END

SESSION

Figure 1-6

A typical menu program

screen

to begin an invoice inquiry program like the one illustrated in figure 1-2. In some cases, the command can include data the program will use as it executes. For example,
DISPINV 010000

could invoke the invoice inquiry program and supply the key of the invoice segment the program should retrieve. Systems that use programs that are invoked like this are called command-driven systems.

Interactive system considerations Now that you're familiar with the kinds of programs that can make up an interactive system, you need to be aware of some of the special problems interactive applications must be able to handle. In this section, I'll cover four basic problems common to all interactive systems: shared data, response time, security, and recovery. Shared data A batch program has exclusive control over the data bases it processes, so there's no chance that another program can interfere with its processing. In an interactive system, however, many

An introduction to interactive programs

15

terminal operators use the system at the same time, and they all must have access to the data bases they need. As a result, an interactive system must provide for shared data by coordinating updates so two programs don't update the same data at the same time. Response time Response time is another special consideration for interactive systems that isn't a concern with batch systems. Quite simply, response time is how long an operator has to wait for a transaction to be processed. A response time of several seconds is probably good, while several minutes probably isn't. Many factors affect response time: the number of users on the system, the storage available, the speed of the disk units in use, how system parameters are set, how fast telecommunications lines are, and how application programs are written. As in the batch environment, keeping your DLiI calls few and simple will improve your programs' response times. Security In a batch system, security is easy to maintain because there's only one access to the computer system: the computer room. However, in an interactive system, terminals are located in many places, and security is a problem. Both IMS and other MVS systems software components provide security with basic logon controls that keep unauthorized users off the system and with access control features that restrict users to just the data and programs they need.
Recovery from system and program failures is complex Recovery enough in the batch environment, but the additional requirements of interactive processing make it even more complicated. IMS includes sophisticated recovery features that make recovery as fast and efficient as possible. For the most part, recovery is transparent to the application programmer, so I mention it here just for perspective.

Discussion Fortunately, many of the details of shared data, response time, security, and recovery are managed for you by IMS. As a result, the IMS application programs you develop are largely insulated from the complexities these considerations impose on the system. Nevertheless, you still need to be aware of them. When I introduce IMS functions in chapter 3, you'll see how IMS provides these services.

Potrebbero piacerti anche