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

8-: 3
application menus to users. They ensure that users execute only the
programs that they are authorized to use. UDCs are discussed in length
in the operating system commands reference manual.
You can create a UDC file with any standard text processor. Once you
create it, you must add it to the system command Directory with the
system SETCATALOG command (see your operating system commands reference
manual for more information on SETCATALOG). To execute a UDC, type its
name at the operating system colon prompt. For example, Figure 8-2 shows
a UDC file containing three UDCs: DAILY, MONTHLY and YEARLY. These UDCs
produce daily, monthly and year-end reports. To print only the year-end
report, type:
:YEARLY
_____________________________________
| |
| DAILY |
| COMMENT - DAILY REPORT |
| RUN RPT10.PROGRAM |
| ** |
| MONTHLY |
| COMMENT - MONTH-END REPORT |
| FILE DETAIL=ALLMONTH |
| RUN RPT10.PROGRAM |
| RESET DETAIL |
| ** |
| YEARLY |
| COMMENT - YEAR-END REPORT |
| STREAM RPT20.JOB |
| ** |
| |
_____________________________________
Figure 8-2. A Simple UDC
Figure 8-3 expands the UDC shown in Figure 8-2 and makes it more
flexible. One UDC, REPORT, replaces the three UDCs in Figure 8-2.
REPORT displays a menu of available reports. When the user selects a
report (DAILY, MONTH-END or YEAR-END), the UDC validates the choice. If
the selection is valid, the UDC starts the appropriate report program.
REPORT uses the logic command, IF, to validate the report choice and
start the appropriate report program. It also uses a User-Defined JCW
(OPTJCW) for storing the user's report choices. For information on the
User-Defined JCWs, see "Communicating File Information" or refer to the
MPE XL Intrinsics Reference Manual
.