4.12.2 About LANSA Debug Mode
As mentioned already the RPG program that was compiled by LANSA from the RDML commands can be debugged using the CPF or IBM i DEBUG facility.
However, LANSA provides a debugging facility that is an extension of the IBM i DEBUG facilities and is much easier to use. The reasons that it is much easier to use are:
- It operates at the RDML level. The actual RDML commands are debugged and not the resulting RPG statements (of which there may be hundreds and they may appear quite cryptic).
- No knowledge of the IBM i debug facility, program names, source statements numbers or field names is required. Using simple displays you can choose the statements and the fields required.
LANSA Debug allows three types of Debugging facilities:
1. DEBUG Interactively. This is commonly known as a 'Breakpoint' facility. This allows RDML commands to be selected to halt execution of the function prior to executing the selected statement(s) and in addition allows selection of the Function variables to be displayed with their current values in Character, Zone and Decimal format.
2. TRACE All/Selective statements. This visually displays via a printed report the sequence of RDML commands executed within the function. It allows RDML commands to be selected to halt execution of the function prior to executing the selected statement(s) and in addition allows selection of the Function variables to be printed with their current values in Character, Zone and Decimal format. When the function completes a message is issued informing that the TRACE report is available to be displayed or printed.
3. COUNT statements. This will count the number of times each RDML command is executed within the function and produce a printed report detailing the RDML commands in the function and the count value for each RDML command. This acts as a useful cross-reference to ensure that RDML commands are being executed within the relevant logic structure of the function. It will certainly help in discarding redundant code and to highlight performance issues. When the function completes a message is issued informing that the COUNT report is available to be displayed or printed.