Program error monitor
|Program Error Monitor allows developers to be immediately aware of malfunctions occurring in their programs
and provides them with the documentation needed to understand the cases and to start providing fixes.
When a program error occurs
Note- This support is available only for ILE-RPG programs.
- a message is displayed to the end-user
- an e-mail message is sent to the appropriate developer, with some indications about the error
- the message sent also allows to display via HTTP the joblog and the source of the failing program
|1- Program Error Monitor set up|
The following data base file must be populated with local information.
Use STRDFU option 5 (Update data using temporary program) to maintain data.
- File EPOLICEDTA/LIBRARIES
For each application program library enter (see Figure 1):
Note 1- You can enter multiple records (multiple developers) for a given application program library.
- the library name
- the developer's name
- the developer's e-mail address
- if you want to use the MMAIL SMS support, the person ID as specified in the MMAIL SMS phone book MMAILDATA/CLICKABOOK
(see this page).
Note 2- You do not have to specify all the application program libraries. You may enter
*ALL (uppercase, please!) as an application program library name. When a program error
occurs for a program belonging to a library not documented in this list, it will default to application library name *ALL.
Note 3- You can enter multiple records (multiple developers) also for application program library *ALL.
|2- ILE-RPG programs setup|
The ILE-RPG program/module sources adopting this tool, must:
- include the following statements (see figure 2 as an example):
These statements generate a Program Error Subroutine (*PSSR), which receives control in case of program error.
See later for the behavior of this subroutine.
- in each file specification, add the keyword
- after the file specifications, add the following statements
See figure 2 as an example.
- at the end of the source
- be compiled with the following parameter:
- for ILE-RPG modules and ILE-RPG bound programs
- for SQL-RPG modules or programs
|3- E-Police program error subroutine (*PSSR) - How it works|
The following is about the E-Police program error subroutine *PSSR that you may add (see above) to your ILE-RPG programs.
This is just for your information, no action from your side is required.
The E-Police program error subroutine *PSSR calls program EPOLICE/Q_FILEERR which does the following:
- The joblog level is changed to (4 0)
- A program error information record is added to file EPOLICEDTA/ERRORS. The information includes:
- system name
- timestamp of when the error occurred
- qualified job name
- qualified name of the program in error
- qualified name of the source member the program was compiled from
- number of the program statement in error (see compile options above)
- name of the file where the last I/O was performed
- ID and text of the error message
- full program status data structure
- A notification of the program error is sent to the user:
- if the program is running under HTTP, an HTML page is sent to the remote browser (see figure 3)
- if the program is running in interactive mode, a display file screen is sent to the display file device (see figure 4)
- if the program is running in batch mode, a break message is sent to the job user profile message queue (see figure 5)
and a program message is sent to the *EXT message queue (so that it is displayed in the joblog).
- An e-mail message is sent to the program developer(s), according to the data found in file EPOLICEDTA/LIBRARIES.
See the example in figure 6.
Acting from the e-mail message, the developer may then display via HTTP
- the joblog (see figure 7)
- the program source (see figure 8).
As examples, after adding a developer record for library EPOLICE to file EPOLICEDTA/LIBRARIES (also a record for library *ALL is OK),
try to run
You may run them in interactive mode, in batch mode and even under HTTP (e.g.
- program EPOLICE/SAMPLE1 (see figure 8)
- or program EPOLICE/SAMPLE2 (see figure 9).
See what happens.
Note- Program SAMPLE1 tries to divide by zero, while SAMPLE2 tries to write a duplicate key record to a database file.
|5- Useful commands|
Some useful commands within the EPOLICE Program Error Monitor:
- Command EPOLICE/RCVJL (receive joblog) receives the joblog entries of an active job into file QTEMP/JLOG (which is
automatically created). It could be useful for other local applications.