310 pts.
 how to access any particular menber of any pf
Hi, if i have a pf having 5 members..how can i access 3rd member of it through in rpgile.. regards Ambrish

Software/Hardware used:
ASKED: November 7, 2009  4:47 AM
UPDATED: November 11, 2009  7:17 PM

Answer Wiki:
You can issue an ovrdbf command in a CL prior to calling the Rpg program. Phil ========================================================== Assuming RPG IV in a reasonably recent release: <pre> F someFile IF E K Disk infds( someFileDS ) F extfile( MYFILE ) F extmbr( MYMBR ) D MYFILE c const( 'MYFILE' ) D MYMBR c const( 'MYMBR3' ) </pre> The EXTFILE() and EXTMBR() keywords can refer to literals or variables. If you use a variable, you can close the file, change the variable value and open the file against a different member. Tom
Last Wiki Answer Submitted:  November 9, 2009  4:26 am  by  philpl1jb   44,630 pts.
All Answer Wiki Contributors:  philpl1jb   44,630 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

could u please suggest an example………….

 310 pts.

 

suggest an example………….

An example of what? I supplied code that shows an example. What else is possible? If you can provide a basic program that reads a file with multiple members that you have, I can reply with changes that would cause it to read a different member.

Tom

 110,115 pts.

 

Tom’s answer looks good
Then in the C-specs you can have a read loop from somefile and you wll be reading the data in MyFile MyMbr3. You show us some code and we’ll help.
Phil

 44,630 pts.

 

Using OVRDBF command, we can achieve this

 1,040 pts.

 

Hi Tom/Philip,
it is said with out using OVRDBF one can read a specified member in a file. Please mention the process if any thing of this kind is available. I think the answer is in using a flat file.

thanks

 1,150 pts.

 

Tom’s answer doesn’t reqyure an override.
Phil

 44,630 pts.

 

The comment by Ten2008 suggesting using a flat file is not relevant.
Whether a file is a flat file or and externally defined file, it can still have multiple members.

 33,695 pts.