Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Debugging the RDML commands in ADDRECS is described in detail in the following steps.

Step 1

Turn LANSA debugging mode on. This has already been described.

Step 2

Select the option to use process EXAMPLE. This is exactly the same as electing to use process EXAMPLE in the normal way. This results in the menu associated with process EXAMPLE being displayed. Function ADDRECS is the first entry on the menu.

 
 EXAMPLE                    DEBUG EXAMPLE PROCESS                      
                                                                       
 Enter number of function or place cursor on same line and press enter 
                                                                       
   __ 1.  Add records to the name & address file                       
      2.  Display process or function HELP text                        
      3.  Display process main menu                                    
      4.  Select from list of available functions                      
      5.  Exit from system                                             
                                                                       
                                                                       
  Fnn=Help  Fnn=Exit  Fnn=Cancel  Fnn=Messages                         
 

Step 3

Elect to use function ADDRECS from the display in Step 2. This is exactly the same as electing to use function ADDRECS in the normal way. The resulting display is the first "interruption" to the normal flow of events.

...

If Options 1 or 2 were selected then the following displays will be shown requesting the relevant selections to be made. If Option 3 was selected then the function will immediately start to execute and act as if it is not in DEBUG mode i.e. no DEBUG interaction.

Step 4

For Options 1 and 2 only, the resulting display is the second "interruption" to the normal flow of events.

...

This screen states that function ADDRECS is in debug mode and requests that the RDML commands that are to be halted before execution are selected.


Note

Note: On this screen, it is possible to:

  • Find a particular sequence number. To do this, enter the sequence number required in the 'Position at Seq' field and press enter. If the sequence number entered is beyond the range of sequence number, the last sequence number will be displayed.
  • Find forwards. To find a particular string of characters enter them into the 'Find' field and select command key 16. If the string is found, the cursor will position on the first character. Please note that words split over lines will not be found.
  • Find backwards. To find a particular string of characters in the RDML prior to where the cursor is currently, enter them into the 'Find' field and select command key 17. If the string is found, the cursor will position on the first character. Please note that words split over lines will not be found.
  • Select all RDML lines. To select all the available RDML statements for breakpoint, use command key 20. The Select Variables screen will then be displayed.
  • When RDML statements are selected, they will automatically be retained, along with any selected variables. When the function is run again under debug mode, the previous RDML statements selected will be indicated as selected. This will occur within the duration of a job. The retained breakpoints will be lost after signing off and also if the function is recompiled since they were selected.

In this case statement 6 has been chosen. DEBUG will stop the function just before executing statement 6. (i.e. just before attempting to insert a new record into the name and address file).

Step 5

For Options 1 and 2 only, the resulting display is the third "interruption" to the normal flow of events.

...

If no RDML commands were selected in Step 4 then this display will not be shown.

In this case, the Function variables DEMAD1, DEMAD2, and DEMNAC have been chosen to be displayed/printed at execution halt, in this example the variables will be displayed/printed just prior to the execution of statement 6.

Step 6

Function ADDRECS now begins to execute. Statements 3 and 4 are executed. When statement 5 is executed the normal display results.

...

Into this screen, details of a new name and address are entered.

Step 7

When Enter is pressed in the preceding step function ADDRECS completes execution of statement 5. However, since debug is on it should halt before executing statement 6. If Option 1 from Step 3 was selected then the following debug display results otherwise the function continues processing.

...

  • The statement about to be executed is indicated at the top of the screen and is highlighted. It is possible to roll through the top display of three RDML lines to show statements which come before and after the current statement.
  • The bottom half of the screen displays all the fields that were selected from Step 5. Shown are the LANSA field name, the RPG field name, the description, Value of the fields (in Character, Zone, and Decimal formats), type, and length. If the LANSA field name is more than 6 characters long it will be different to the RPG field name. LANSA internally renames fields that are more than 6 characters long so that the RPG program will compile.
  • The "Search for Variable" allows input for a variable name to be searched for against the list of variables that were requested to be displayed from Step 5. The Search if found will position the Cursor against that variable or in the case of a Generic search the cursor will be positioned against the first variable meeting the Generic search criteria.
  • The "Act" column allows a number of actions to be taken on any of the fields displayed. These are:

    D

    Display the contents of the field.

    H

    Display the contents of the field in hexadecimal form.

    P

    Print the contents of the field.

    C

    Change the contents of the field.

  • The function key "F10=Services" allows the various Debug service options to be actioned from a POP UP style services menu. This will be explained in Step 8.
  • The function key "F11=Step Next" allows the execution of the current statement and then halt halts at the next statement to be executed.
  • The function key "F15=Vars Y/N" allows the display to be shown with:
  • variables and only three lines of RDML or
  • without variables but a full screen of RDML lines.
  • The function key "F19=Hex Yes/No" allows the display to be shown with hex values or without hex values.

...

So the function continues to execute - stopping whenever requested to display or change the contents of fields.

Step 8

If Function key 10 is used the "Edit Services" Menu will be displayed.

...

The "Edit Services" menu is only ever available when the debug mode is on, debug option is DEBUG Interactively, and when the function is at a debug statement halt.

Step 9

The final step in this example is to turn debug mode off and to display or print the Debug TRACE or COUNT report if selected.