EXTMBR keyword in RPGLE

195 pts.
Tags:
AS/400
RPGLE
Can I use multiple members in EXRMBR keyword in RPGLE? I know we can use one member name in EXTMBR but my question is can we place multiple members name in that apart from *ALL. Can someone please help me here? My requirement is to read 4,6,8 member from my 10 member PF. I know we can create three logical files and achieve this but I don't want to create multiple logical files.
1

Answer Wiki

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

You can:

1. Create 1 LF that includes all 3 members

2. Copy data from 3 members into a new single member

3. Define the same file 3 times and process each one.

4. Use a variable name for extmbr and call the same program 3 times.

Discuss This Question: 5  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.
  • TheRealRaven
    Does the documentation show that multiple names are allowed?
    34,430 pointsBadges:
    report
  • philpl1jb

    Here are a few ideas

    1. Can you process one at a time.

    Close file .. change name .. open file

    2. Otherwise use *all and use the file data structure to determine if the record is from one of the correct members.

    54,090 pointsBadges:
    report
  • Splat
    Assuming the names of the members are known, using a variable in the EXTMBR keyword in combination with the USROPN keyword would obviate the need to call the program 3 times.  Assign the variable, open the file, process the data, close the file; repeat as necessary.
    12,865 pointsBadges:
    report
  • ToddN2000
    Do all 3 members need to be accessed at the same time? Do they all need the same logical view? You could possibly try doing this in a CL using the OVRDBF command. Just point each file to a different member.
    131,595 pointsBadges:
    report
  • TheRealRaven
    Opening/closing the file with a variable for EXTMBR() is the most direct method. The tricky part will be determining which ones are members 4, 6 and 8, since members aren't numbered.

    Should they be accessed in the order they were 'Last Changed'? The date they were created? Alphabetic by name? Some other sequence?

    Deciding a method for one file might not fit a different file.
    34,430 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.

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

Following

Share this item with your network: