PRODAMP (PROcedure language for DAMP) is a language similar to Pascal for the formulation of diagnostic algorithms in DAMP. PRODAMP runs under DAMP and utilizes the functions offered there, such as symbolic addressing of data structures or output in various formats in screen windows.
With PRODAMP, it is possible to write decision-based statements, which would otherwise have to be entered individually by hand, into a procedure and to execute them automatically. It is possible, for example, to follow chains down to a structure which contains a specific data item, to search tables and process (e.g. arithmetically) the values they contain, or to have questions such as “Is this task holding a lock?” answered automatically.
Example
Let us assume that you frequently have to analyze problems where the program crashes due to a DMS error, and where the only aid at your disposal is a user dump. In order to identify which file and which DMS error code are involved, the following basic steps are necessary:
Assign a dump file.
Select the PCB which issued the DMS macro.
Mark register 1 in this PCB.
Assign the area (FCB) addressed by register 1 to another window.
Overlay this area with the DSECT of the FCB.
Position to the field ID1FILE (file name).
Position to the field ID1ECB (error code).
Steps 3 through 7 can be written as a PRODAMP procedure and subsequently executed automatically whenever it is needed.
For example, if the procedure was stored under the name “DMSERR”, the overhead involved in determining the DMS error code is reduced to the following steps:
Assign the dump file.
Select the PCB which issued the DMS macro (to provide values for CURRENT.PCB).
Issue the DAMP statement START-PRODAMP-PROGRAM DMSERR.
The PRODAMP procedure DMSERR would look something like this:
FNAM := ' '*54; ERR := 0; P := CURRENT.PCB; FCB@ := P.ESTKGR1; FNAM := FCB@.ID1FILE; ERR := FCB@.ID1ECB ; MESSAGE ( 'DMS ERROR '+HEX_STRING(ERR)+' FOR FILE '+FNAM );
This procedure offers even more than the individual steps listed above: the desired information is edited and displayed on the screen, saving you the bother of searching through the contents of the output window.
A procedure written in the PRODAMP language (PRODAMP source code) cannot be executed directly, but must first be compiled to form a PRODAMP program (PRODAMP object code). Compilation can be carried out in a PRODAMP window, which also provides a complete development environment for PRODAMP procedures. This window is called using the DAMP statement START-PRODAMP-EDITOR. In this window, you can store source code and generated objects in a PRODAMP library as well as perform editing and compilation operations and run procedures on an ad hoc basis. The DAMP statement START-PRODAMP-PROGRAM also allows you to run PRODAMP programs from a PRODAMP library.
PRODAMP can thus handle routine tasks which have to be executed before you reach the actual heart of the problem.