ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How to get rid of decimal data error when RPGLE program submitted in a job.

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

  • How to get rid of decimal data error when RPGLE program submitted in a job.

    I have a RPGLE program (PGMR1) which is being called in a batch Job (JOB1). The RPGLE reads all records from an input file INPF1 (having 5 fields ? INF1 ? INF5 ? all character fields) and writes to an output file (having 5 fields ? INF1 ? INF5 ? all numeric fields) depending on some conditions.

    I am moving the input file character data to output file numeric data.
    Now if any of the input file field contains junk value then the RPGLE program fails and the job goes to message wait.

    My question is as a support team member how can I handle this job (without killing it) so that it ignores the erroneous record and processes all other records properly??

    Thanks in Advance....

  • #2
    Re: How to get rid of decimal data error when RPGLE program submitted in a job.

    Monitor for the unvalid data and take the appropriate action.

    If you wish to ingore the field and process the rest of the fields:
    Monitor
    Eval NumOut1 = %Dec(NumInput1:5:0) // Length is 5,0
    On-Error
    Eval NumOut1 = *Zero
    Endmon

    Or if you wish to ignore the record:
    Monitor
    Eval NumOut1 = %Dec(NumInput1:5:0) // Length is 5,0
    Eval NumOut2 = %Dec(NumInput2:5:0) // Length is 5,0
    Eval NumOut3 = %Dec(NumInput3:5:0) // Length is 5,0
    Eval NumOut4 = %Dec(NumInput4:5:0) // Length is 5,0
    Eval NumOut5 = %Dec(NumInpu5:5:0) // Length is 5,0
    Write NewRecord
    On-Error
    // do nothing if error occured
    Endmon
    Last edited by Billw; March 23, 2010, 07:13 AM.
    Bill
    "A good friend will bail you out of jail,
    A true friend would be sitting beside you saying,
    'Wow, that was fun.'"

    Comment


    • #3
      Re: How to get rid of decimal data error when RPGLE program submitted in a job.

      When you compile your RPGLE program, try compiling with FIXNBR(*ZONED)

      Comment


      • #4
        Re: How to get rid of decimal data error when RPGLE program submitted in a job.

        These are all programmers solutions. As it's support I think the job is already at MSGW and they want to know how to let the job continue.

        If you take option 7 against a job at MSGW you can reply to the message. There will be options to cancel the job, dump the program data to a spool file or hopefully to carry on processing. You could try letting the job carry on in this way? You might have to answer a couple of messages before it will continue. Sometimes if the crash is fatal it won't be able to continue and you'll keep getting errors.
        Ben

        Comment

        Working...
        X