IBM AS/400 Manuel D’Utilisation

Page de 489
 
Running a Program From a Menu-Driven Application
 
 
 
A*****************************************************************
A* DESCRIPTION:
This is the DDS for the physical file EMPMST.
*
A*
It contains one record format called EMPREC.
*
A*
This file contains one record for each employee *
A*
of the company.
*
 
A*****************************************************************
 
A*
 
A
R EMPREC
 
A
ENUM
5
0
TEXT('EMPLOYEE NUMBER')
 
A
ENAME
20
TEXT('EMPLOYEE NAME')
A
ETYPE 
TEXT('EMPLOYEE TYPE')
 
A
EDEPT
3
0
TEXT('EMPLOYEE DEPARTMENT')
A
ENHRS
3
1
TEXT('EMPLOYEE NORMAL WEEK HOURS')
 
A
K ENUM
Figure  48.  DDS for EMPRPT2
Running a Program From a Menu-Driven Application
Another way to run an ILE program is from a menu-driven application. The work-
station user selects an option from a menu, which in turn calls a particular program.
Figure 49 illustrates an example of an application menu.
‡
—
PAYROLL DEPARTMENT MENU
 Select one of the following:
1.
Inquire into employee master
2.
Change employee master
3.
Add new employee
 Selection or command
 ===> _________________________________________________________________________
_______________________________________________________________________________
F3=Exit 
F4=Prompt 
F9=Retrieve 
F12=Cancel
 F13=Information Assistant
F16=AS/400 main menu
ˆ
 
˜
Figure  49.  Example of an Application Menu
The menu shown in Figure 49 is displayed by a menu program in which each
option calls a separate ILE program. You can create the menu by using STRSDA
and selecting option 2 ('Design menus').
Figure 50 on page 107 shows the DDS for the display file of the above PAYROLL
DEPARTMENT MENU. The source member is called PAYROL and has a source
type of MNUDDS. The file was created using SDA.
106
ILE RPG for AS/400 Programmer's Guide