Search code examples
databasedebuggingibm-midrange

How to debug specific records in tables on the AS400 system


I'm working on attempting to debug a problem with an Interest rate calculation that is performed on several thousand records out of a few million in an RPG program on an AS400 system. Right now, a very small number of records in a very large table have interest values assigned to them that are absurd (multiple times the principle for a period of a few months).

I have been trying to solve this problem by using the built-in as400 debugger to determine why the calculation is failing by debugging the specific problem records. However, I have been unable to find a way to read one of the problem records directly or otherwise access it in the debugger (I have tried using conditional breakpoints, however they are time inefficient due to the size of the table).

Is there a way to directly access/read a specific record while debugging in an RPG Dow %eof type loop?


Solution

  • Is there a way to directly access/read a specific record while debugging in an RPG Dow %eof type loop

    No. You'd need to be using CHAIN or SETLL/READE to access a specific record.

    Assuming you don't have a separate development/test environment...

    Without changing the program code, you could create a new copy of the table with just the problematic records. Then use the Override Database File (OVRDBF) command to force your program to access your copy of the table instead of the regular one.

    If you have a separate environment, you could still pare down the data to the problematic records.