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 philpl1jb44,630 pts.
All Answer Wiki Contributors: philpl1jb44,630 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.
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’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
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.
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.
could u please suggest an example………….
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
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
Using OVRDBF command, we can achieve this
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
Tom’s answer doesn’t reqyure an override.
Phil
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.