How do you know if a record exists without doing a READ and CHAIN?

15 pts.
Tags:
AS/400 Records
RPG IV
How do you know if a record exists without  doing a READ and CHAIN? is it possible with BIF's or ?

Software/Hardware used:
AS/400

Answer Wiki

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

Hi,
you can use SETLL and equal indicator to a specified record format/file name. If the record exist indicator is on otherwise not .

ORDER SETLLORDFIL 55 PRESNT
N55 GOTO NOTFND

Here if the indicator 55 is on then the record exists.

all the best
Ram

—-

Using %BIF

<pre>
SETLL(e) searchval Recordformat

IF %Equal ;
DSPLY “Yay, found the record”;
ENDIF;
</pre>

Discuss This Question: 1  Reply

 
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
  • Splat
    Nice thing about using SETLL is that it doesn't load the record buffer, so the operation is faster than using a CHAIN or READ operation.
    7,235 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