The idea for this post came from a discussion I saw on Facebook. Someone asked:
- In your RPG how can you read from a particular member of a file?
- By default which member is read?
- How can you read all the members of your PF in your RPG program?
- How can you find out which member is being read?
The answer for the first question is to use the EXTMBR in the File specifications. I will not go into details about this as it is covered in Useful keywords for your F-specs.
The answer for the second question is that when a program opens a file with more than one member, by default, it opens the first member, which is the oldest member as that was the one created first.
The third and fourth questions I combined into my own scenario: I want to have a program that reads all the members in a multi member file to find a particular record and identify which member this record is in.