File access in Rpg

75 pts.
Tags:
CL
OVRDBF
RPG
Hi All, Suppose you have 3 members in a database file. How to read records from all the members without using CL (OVRDBF) ie it should be handled exclusively in an RPG program? Thanks Venkat

Answer Wiki

Thanks. We'll let you know when a new response is added.

You will still use the OVRDBF but put it in the rpg program
1. Make the f spec USROPN
2. Issue the OVRDBF with member(*all) using QCMDEXC
3. Open the file.

From WaltZ400

You can also place the EXTMBR keyword on the F-Spec for the file. To open and read all members use EXTMBR(‘*ALL’). Make sure *ALL is all caps and alos between quotesas shown.

You can use a logical file which is based on *ALL members

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Renojim
    There is, in my opinion, a better way. Define your file with the 'EXTMBR' keyword, including a 10 byte alpha field, 'todaymbr' in my example, and make it usropn: FMYFILE UF A E K DISK Extmbr(TodayMbr) UsrOpn Put the member name in 'todaymbr' and OPEN the file. It will point to the member you want. CLOSE the file, change the member name in 'todaymbr', and OPEN the file, it will point to your new member. have fun. renojim
    145 pointsBadges:
    report
  • philpl1jb
    True that method allows access to one member at a time. If all data from all members are needed based on the PF key then I think the OVRDBF is needed.
    49,730 pointsBadges:
    report
  • Renojim
    After I answered I realized that that was the original request. My bad. However, you can still use EXTMBR(*ALL) and avoid having to use QCMDEXC.
    145 pointsBadges:
    report
  • tjgm88
    I wonder if one can do this: Create a Logical file over all the three members and open this logical within the RPG program. Cheers!
    995 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following