ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Retrieve line code at runtime

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Retrieve line code at runtime

    Hello,

    I have a rather particular need.

    I need to debug a 15 thousand lines of code program with complicated business rules, and with a lot of use of COPY where depending on the business rule you can use the same variable with another name.

    It is a program from 30 years ago that nobody knows the business rule well, and nobody wants to modify it, the point is that there is an error in the program and I need to quickly determine 5 rules. And where the program goes through each of those rules for about 500 specific accounts (depending on the type of account does one thing or another)

    The question: Is there any way to automatically record the "CODE LINE" once you launch the program? That is not by display, by display I need to know where it will pass. In this case what I need is that I print in the spool or a table where I pass according to each case.

    Thank you

  • #2
    To make sure I understand - when the program is run, you want it to record the source for every line of code the program runs through, separately for every account it processes?

    Comment


    • #3
      Originally posted by Vectorspace View Post
      To make sure I understand - when the program is run, you want it to record the source for every line of code the program runs through, separately for every account it processes?
      Exactly!!

      Comment


      • #4
        RDi's code coverage tool can record which lines were executed, but it depends on the program having been compiled with the correct debug settings. And in addition, it will record for one execution of the program, not separately for each account.

        I'm not aware of any tool that will do exactly what you ask. If it was me, I would run the program for a single account in debug and step through the code. Either that or create a modified copy of the program that logs additional data. In either case, it would be on the test environment against a copy of the required data.

        Comment


        • #5
          Originally posted by Vectorspace View Post
          RDi's code coverage tool can record which lines were executed, but it depends on the program having been compiled with the correct debug settings. And in addition, it will record for one execution of the program, not separately for each account.
          Thank you for your answer. Is this compilation tool or directive enabled for OPM? cobol programs for example?

          Comment


          • #6
            That I don't know

            Comment


            • #7
              Have you used the Trace function? This will make a list of every line used in an execution. then you can display it on your screen or to a print file. go cmdtrc

              Comment


              • #8
                Originally posted by Gary B View Post
                Have you used the Trace function? This will make a list of every line used in an execution. then you can display it on your screen or to a print file. go cmdtrc
                I've never really used it, I didn't know this utility existed. I will check how it works.
                Thank you

                Comment

                Working...
                X