RPG

70 pts.
Tags:
RPG
RPG Records
How to read distinct record through RPG?

Software/Hardware used:
AS/400

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.

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

Discuss This Question: 4  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
  • TomLiotta
    It's not clear what you want. The RPG Reference manual tells you how to do it. But here is one possibility:
    /free
     exec sql SELECT col1 , col2 , col3 , col4
                  INTO :HOSTVARS
                  FROM mylib/myfile a where keycolX= :HOSTKEY;
    /end-free
    If KEYCOLX uniquely identifies a row that you want and the HOSTKEY variable contains the key value that you want, then that will retrieve the listed columns into the data structure named HOSTVARS. If necessary, the DISTINCT keyword can be added to the SELECT statement.
    .
    Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    chain is a native command to read a specific record by key.
    49,850 pointsBadges:
    report
  • TomLiotta
    @Phil: . Sure, but anyone can get that right out of the Language Reference manual (or class notes.) . Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Yes, of course. It's obvious and readily available to you and I, but we don't know what's obvious to dwivediviv.
    49,850 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