Midrange News for the IBM i Community


Posted by: deepthi
multiple member files in RPG programming
has no ratings.
Published: 01 Jun 2012
Revised: 23 Jan 2013 - 1785 days ago
Last viewed on: 13 Dec 2017 (4758 views) 

Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.

multiple member files in RPG programming Published by: deepthi on 01 Jun 2012 view comments(3)

If a file has more than 1 member then how can i access/read/update a member (other than first) of that physical file in RPG.

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: Paulster
Premium member *
Sweden and The Netherlands
Comment on: multiple member files in RPG programming
Posted: 5 years 6 months 14 days 12 hours 54 minutes ago

You can either override to the required member before starting your RPG program or you can spcify the member on your F specs in the RPG program. Check out the extmbr() keyword for F-specs.

Posted by: Ringer
Premium member *
Comment on: multiple member files in RPG programming
Posted: 5 years 6 months 14 days 5 hours 50 minutes ago

Yeah, just know that if both an OVRDBF and the ExtMbr() are used, the OVRDBF takes precedence.

Chris R

Posted by: DaleB
Premium member *
Reading, PA
Comment on: multiple member files in RPG programming
Posted: 5 years 6 months 14 days 4 hours 30 minutes ago
Edited: Fri, 01 Jun, 2012 at 10:22:00 (2021 days ago)

Note that the parameter to EXTMBR() can be a field name. If the file is opened automatically (no USROPN), you need to make sure the field has a value during initialization. For example, it could be an incoming parameter, or the field could have an INZ.

If you have EXTMBR() with a field, with USROPN, you choose when to OPEN the file. In this case you need to make sure you set the field's value to the member name before you do the OPEN. You could later CLOSE the file, change the field, and reopen with a different member name.