5 pts.
 ACCESS PARTICULAR MEMBERS IN RPG
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
ASKED: October 31, 2009  11:34 AM
UPDATED: November 3, 2009  7:35 PM

Answer Wiki:
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 Hatmaker   1,495 pts.
All Answer Wiki Contributors:  Craig Hatmaker   1,495 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Overide always works for me.

 1,780 pts.

 

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,830 pts.