how to access any particular menber of any pf
275 pts.
0
Q:
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
ASKED: Nov 7 2009  4:47 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
7555 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
You can issue an ovrdbf command in a CL prior to calling the Rpg program.
Phil

==========================================================

Assuming RPG IV in a reasonably recent release:

F someFile IF E K Disk infds( someFileDS )
F extfile( MYFILE )
F extmbr( MYMBR )

D MYFILE c const( 'MYFILE' )
D MYMBR c const( 'MYMBR3' )

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 Answered: Nov 9 2009  4:26 AM GMT by TomLiotta   7555 pts.
Latest Contributors: Philpl1jb   24510 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



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

Ambrish 82   275 pts.  |   Nov 9 2009  4:10AM GMT

could u please suggest an example………….

 

TomLiotta   7555 pts.  |   Nov 10 2009  12:22AM GMT

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

 

Philpl1jb   24510 pts.  |   Nov 10 2009  1:15AM GMT

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

 

Rajeshece   480 pts.  |   Nov 11 2009  8:40AM GMT

Using OVRDBF command, we can achieve this

 

Ten2008   730 pts.  |   Nov 11 2009  11:24AM GMT

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

 

Philpl1jb   24510 pts.  |   Nov 11 2009  12:05PM GMT

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

 

CharlieBrowne   6350 pts.  |   Nov 11 2009  7:17PM GMT

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.

 
0