ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

decimal data error

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

  • decimal data error

    I get below error while debugging my program

    Message . . . . : Decimal-data error occurred (C G D F).
    Cause . . . . . : RPG procedure ABC025 in program DLESTER/ABC025 found a
    decimal-data error at statement 501. A packed or zoned value does not
    contain valid numeric data. A digit and/or sign is not valid.

    501 statement is
    EVAL ABC_32A_WHLPOS = %abs(ABC_32A_WHLPOS)

    ABC_32A_WHLPOS is defined as
    D ABC_32A_WHLPOS...
    D 12 0
    D 1 inz(',')

    But it appears to me valid data , how can I further debug the problem to find whats going on and to fix it...

    All help is appreciated.
    Donna

  • #2
    Re: decimal data error

    Use start debug command

    STRDBG PGM(program) UPDPROD(*yes)

    set a break point at the statment in error and display the variable

    Comment


    • #3
      Re: decimal data error

      Hi
      You don't have to set the break point, because program will stop at the certain line, when condition will be met.
      LP Zdenko

      Comment


      • #4
        Re: decimal data error

        That's true you don't have to set the break point. I do it out of habit.

        In hind sight you could skip the debug and just take a dump on the error. Then check the value in the printout.

        Comment


        • #5
          Re: decimal data error

          I can't quite follow your field definition for ABC_32A_WHLPOS (due to spacing) - is it a numeric field with INZ to a comma ? You can't put commas or periods in numeric fields.

          Comment


          • #6
            Re: decimal data error

            What is ur D-Spec ....

            D ABC_32A_WHLPOS...
            D 12 0
            D 1 inz(',')


            Its quite confusing ...

            D ABC_32A_WHLPOS S 12 0 Inz(',')
            Is this ur declaration ????

            If u declare above, u can't even compile the program. Because u r trying to put a character field in a numeric field.
            Thanks,
            Giri

            Comment

            Working...
            X