ACCESS PARTICULAR MEMBERS IN RPG
5 pts.
0
Q:
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: Oct 31 2009  11:34 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
725 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
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):
  1. 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 ...)
  2. In your RPG, add the LFs to your F Spec.
  3. You may need to use the RENAME keyword on the F Spec to change the format name to something unique within your program

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:
Similar question's answer:
http://itknowledgeexchange.techtarget.com/itanswers/how-to-operating-with-multiple-member-pf-in-rpg/
Designate Members for LFs:
http://publib.boulder.ibm.com/iseries/v5r2/ic2928/index.htm?info/cl/crtlf.htm
OVRDBF:
http://publib.boulder.ibm.com/infocenter/iseries/v6r1m0/index.jsp?topic=/rbam6/ovrbf.htm
Last Answered: Oct 31 2009  5:52 PM GMT by Chatmaker   725 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

RonKoontz   1355 pts.  |   Nov 2 2009  8:25PM GMT

Overide always works for me.

 

Teandy   3250 pts.  |   Nov 3 2009  7:35PM GMT

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)

 
0