Reading members of a physical file

2920 pts.
Tags:
Physical File
RPG
RPGLE
Hi,
Can somebody please help by providing the program code for reading all the members of a file using RPG or RPGLE program? Suppose a file has 3 members then how to read the records of all the 3 members in a file? Thanks!


Software/Hardware used:
AS/400
1

Answer Wiki

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

This seems like a homework question. You need to learn how to
search the web. You will get answers faster and of a better quality for these
types of questions. This site is for specific technical  issues

Discuss This Question: 6  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.
  • 6r
    this is also a technical question
    2,920 pointsBadges:
    report
  • SimonD
    80 pointsBadges:
    report
  • philpl1jb

    In RPGLE you can use an F Spec for the file with the keyword

    EXTMBR ('*ALL')

    as described here

    http://www.go4as400.com/rpgle-specifications-h-f-d-i-c-o/spec.aspx?cid=52

    54,090 pointsBadges:
    report
  • Splat
    philpl1jb, I didn't know that. Thanks.
    12,915 pointsBadges:
    report
  • ToddN2000
    Are these to be processed one after the other? You could make the file user controlled, override the file, open the file (member) and process. Close the file. Loop back to start of logic and override the next file member, Open, process, close.. repeat till all members processed.
    134,495 pointsBadges:
    report
  • GregManzo
    If you specify *ALL members (either on an override or the EXTMBR keyword) then it will appear to your program that the members were concatenated one after the other; you can process each member in turn in a single pass through the file. (I did this in the 80's to read all QDDSSRC to build a data dictionary)
    If however you need to process the records in a particular keyed sequence regardless of which member they are in (ie jumping from one member to another & back based on the data in the records), then you are better off creating a logical file over the physical and specifying DTAMBRS((*ALL)) so that your single LF member will span all the underlying PF members. (and if you only need some members but not all then you can tweak the DTAMBRS keyword values)
    2,960 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: