ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Debug Showing Some Field Values Empty

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

  • Debug Showing Some Field Values Empty

    I have an RPG doing READE on a logical file, which has all the same fields as the physical. After the READE, some of the field values are populated, but others show 0 or '' , even though they have values when I look at the data through SQL. How can some fields in debug show empty after a READE ?

    In this case the ORDER# is used to READE , but EVAL of the Customer # is 0, when obviously there is a customer #. EVAL of Item# and Description have expected values., but order date is also 0​

  • #2
    RPG won't load the fields that aren't actually used in your program. So you read the file, it only copies the data from the database to your program if the data is going to be used. There is a keyword ("debug" I think it is) where you can tell it to load them all... check the docs for the ctl-opt keyword;

    Comment


    • #3
      Thanks. So if I start to use Customer # in my code, it will work because RPG will see that it is now being used ?
      I don't need to load them all as long as it has a value when used in the program.

      EDIT. Tested, to confirm cust # now has a value when used in the code. Thanks again.
      Last edited by MFisher; March 13, 2024, 08:48 AM.

      Comment


      • #4
        Add DEBUG(*INPUT) to your H spec / CTL-OPT.



        DEBUG keyword, control specification keywords, DEBUG, return value from a procedure, while debugging

        Comment

        Working...
        X