Ask the Expert

Monitor for a fatal RPG III error

In a CL program, how do I monitor for a fatal RPG III error? I have an interactive RPG program that opens a file for update. The file has been exclusively allocated by another job, causing the user to see a system-supplied error screen showing CPF4128 with options to cancel, dump, etc. I'd like to trap that error and display my own message, but MONMSG does not seem to work with a call to an RPG program.

The easiest way to accomplish this is to use an *PSSR routine in your RPGIII program to trap the CPF4128 during the open operation. You can find more information on defining and using the *PSSR routine in the online library by selecting the AS/400 Online Library - English. You will need to use the section: 2.3.2 File Exception/Error Subroutine (INFSR), which will explain the required entries to create your routine.

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.


This was first published in November 2002

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

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

Your password has been sent to: