Program not crashing – MCH0603 error

105 pts.
Tags:
CL Program
RPGLE
I am calling a RPGLE from CL program. RPGLE program tries to add records to a 100 element array. When the count reaches 101, I expect the program to crash with error MCH0603 (Range or subscript error). However, the program ends and I don't get an error message on screen. I have to check logs to find the *Escape message. Why does this happen? I don't even have a MONMSG defined in CL program.

Software/Hardware used:
AS400, RPG, CLLE

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

Discuss This Question: 14  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • Splat
    Do you have any modified compile options? Error trapping in the program? Have you stepped through the code in debug?
    11,175 pointsBadges:
    report
  • sri8707
    Hi Splat, no I don't have any modified compile options. Also, I debugged the program. When the program reaches that particular point, it ends without throwing any error message. Was wondering if MCH*** codes behave that way only.
    105 pointsBadges:
    report
  • Splat
    Not that I know of. Normally there's a diagnostic error generated. Pardon me it this seems elementary, but are you certain the index counter is actually at 101?
    11,175 pointsBadges:
    report
  • sri8707
    Yes it is. The array could hold 100 elements only. When the counter reaches 101, I'm expecting the program to throw a message stating "limit exceeded". But, doesn't happen as expected. The program just ends after that statement and i have to check logs to find the error.
    105 pointsBadges:
    report
  • WoodEngineer
    Does your program have a *PSSR subroutine? If so, it might be catching the error and ending the program.
    7,385 pointsBadges:
    report
  • sri8707
    No, i dont have PSSR defined. I can add MONITOR or MONMSG to prevent the program from abnormal crashing. But i am curious to know the difference between following cases
    1. Error message directly thrown
    2. Error message is present only in the logs
    105 pointsBadges:
    report
  • WoodEngineer
    What is the definition of the field which indexes the array?
    7,385 pointsBadges:
    report
  • sri8707
    The field is defined as:
    D  OptPtr 3  0 dim(100) 
    105 pointsBadges:
    report
  • WoodEngineer
    Is OptPtr the index to your 100 element array?
    7,385 pointsBadges:
    report
  • sri8707
    Didn't exactly get that. Below is what I have:
    D  OptPtr                        3  0 dim(100)     
    D  #Opt                          5  0     
    D OptOcc          S              3  0      Below is the statement that goes to error.
    OptPtr(#Opt) = OptOcc;  
    105 pointsBadges:
    report
  • Splat
    What increments #Opt?
    11,175 pointsBadges:
    report
  • WoodEngineer
    Field #Opt would typically be a stand alone field.
    What error message do you find in the job log?
    You could add a test in the program to execute a DUMP when the counter (Opt#) reaches 100. That should show you everything the program is working with.
    7,385 pointsBadges:
    report
  • ToddN2000
    How do you determine when your counter is being incremented?  What type of loop is it found in in ? IS the index being modified anywhere else in the program?
    82,620 pointsBadges:
    report
  • ToddN2000
    You could also try and run this using DEBUG. Set your index to 99 and step through the program to see what is happening.
    82,620 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: