Access particular members in RPG

5 pts.
Tags:
RPG
RPG/400
RPGLE
Suppose I have a PF with 3 members. Is it possible to do READ/WRITE operation on particular 2 members?

Software/Hardware used:
AS/400

Answer Wiki

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

Greetings Amol123,

Here is an option based on the assumption that you want to access several different members within the same physical file at the same time (such as comparing two members):
<ol><li>Create two (or more) logical files. (The LF’s DDS only needs the PFILE keyword- no fields, no keys) One references the first member (see Designate Members for LFs below). The second LF references the second member. (The third …)</li><li>In your RPG, add the LFs to your F Spec.</li><li>You may need to use the RENAME keyword on the F Spec to change the format name to something unique within your program</li>
</ol>Optionally: Instead of creating the LF’s for only one particular member, create a CLP that first uses OVRDBF to pick which members each LF should use, and then calls your RPG.

References:

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
  • RonKoontz
    Overide always works for me.
    1,780 pointsBadges:
    report
  • Teandy
    If you want to do this inside of the RPG and have at least V5R1, you can use EXTFILE and EXTMBR.
    FFile1     if   e             Disk    Extfile(FilNam) ExtMbr(MbrNam)
     
    
    5,860 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