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.
<b>References:</b>
Similar question's answer:
<a href="http://itknowledgeexchange.techtarget.com/itanswers/how-to-operating-with-multiple-member-pf-in-rpg/">http://itknowledgeexchange.techtarget.com/itanswers/how-to-operating-with-multiple-member-pf-in-rpg/</a>
Designate Members for LFs:
<a href="http://publib.boulder.ibm.com/iseries/v5r2/ic2928/index.htm?info/cl/crtlf.htm">http://publib.boulder.ibm.com/iseries/v5r2/ic2928/index.htm?info/cl/crtlf.htm</a>
OVRDBF:
<a href="http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/index.jsp?topic=/rbam6/ovrbf.htm">http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/index.jsp?topic=/rbam6/ovrbf.htm</a>
Last Wiki Answer Submitted: October 31, 2009 5:52 pm by Craig Hatmaker1,495 pts.
If you live outside the United States, by submitting your email address you consent to having your personal data transferred to and processed in the United States.
Overide always works for me.
If you want to do this inside of the RPG and have at least V5R1, you can use EXTFILE and EXTMBR.