Trap error in COBOL/400

Tags:
AS/400
COBOL/400
Error handling
I want to know how to trap error in cobol400

Answer Wiki

Thanks. We'll let you know when a new response is added.

What type of error? I/O? Arithmetic?

Discuss This Question: 3  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.
  • abhisheka1
    http://publib.boulder.ibm.com/iseries/v5r2/ic2924/books/c092540319.htm
    405 pointsBadges:
    report
  • abhisheka1
    The above link helps you to get overview about exception and error handling techniques in Cobol400.
    405 pointsBadges:
    report
  • anandx
    1. exceptions in all arithmetic operations (add, subtract, divide, multiply and compute) are captured when 'on size error' clause is included and pgm needs to handle the error; if not included then the system's default error handler takes control
    2. For Search, String, Unstring, call and display area 'at end' or 'on overflow' or 'on excpetion' clause gives control to pgm
    3. Database files and display files have 'invalid key' ot 'at end' clauses for pgm to handle exceptions. 
    4. Exceptions not trapped by db and dsp files are handled by pgm in declaratives (similar to but not same as *pssr).
    5. Exceptions/errors that escape all of above can be handled by some IMB's APIs
    6. 'Program status' clause in 'special-names' of COBOL is equivalent to 'psds' of rpg
    7. RPG's 'monitor, on-error' is a kind of universal trap mechanism, unfortunately, COBOL doesn't have any such.
    That's my understanding, I stand corrected where I'm wrong.

    715 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: