CHAIN(E)

85 pts.
Tags:
CHAIN(E)
RPG
what is chain(e) please explane with example
ASKED: April 2, 2008  10:32 AM
UPDATED: May 20, 2011  10:44 AM

Answer Wiki

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

From the WebSphere Development Studio ILE RPG Language Reference Version 5 manual:

<b>To handle CHAIN exceptions (file status codes greater than 1000), either the operation code extender ’E’ or an error indicator ER can be specified, but not both. For more information on error handling, see “File Exception/Errors” on page 65.</b>

An example:

C RECORDKEY CHAIN(E) FILEREC

*> If no record found, write a new one. Otherwise, update the
*> existing One.

C IF %STATUS ( FILENAME ) = 00012 No-record-found
C WRITE FILEREC
C ELSE
C UPDATE FILEREC
C ENDIF

Discuss This Question: 2  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.

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
  • Birddon
    The E extender tells the program that you are handling errors on the CHAIN. You can test for an error condition by using the %ERROR BIF and when it is true, test for specific situations using the %STATUS BIF if that is appropriate for your code. The %ERROR will only work when you specify the E extender on the operation. One thing to be aware of is that if an error indicator is also specified, the program will consider the error handled by the indicator and the %ERROR BIF will not test true. The indicator comes before the E extender in the error handling hierarchy, and the MONITOR comes after the extender.
    45 pointsBadges:
    report
  • Gilly400
    Hi, I'm not sure whether the previous answers were what you were looking for, maybe you just wanted to know what the chain operation does :- Chain is an operation code to retrieve a single data record from a file. The record can be retrieved by relative record number or a key (if the file has a key defined). After a chain operation the record can be updated with new data or the record can be deleted from the file. Regards, Martin Gilbert.
    23,730 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.

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

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

Following