1) Before your program opens the file, specify the Override Database File (OVRDBF) CL command, with overriding member *ALL:
2) Starting with V5R1, you can skip the OVRDBF CL command, and just specify EXTMBR('*ALL') directly on your RPG file specification:
Be sure to include the single quotes in the RPG version. In either case, your program will first open the chronologically first member in the file. To close this member and open the next member in chronological order, code the following:
read MYFILE;
To close this member and open the previous member in chronological order, code the following:
readp MYFILE;
Be aware that your program moves through members in the chronological order that you added the members to the file. This order may differ from the Work with Members Using PDM (WRKMBRPDM) list order, which is alphabetical order.
The RPG file information data structure subfield position 129-138 contains the name of the current member your program has open. When your program closes one member and opens the chronologically adjacent member, RPG updates this subfield, and OS/400 writes informational message CPI5209 to your job log:
Gene Gaunt is the Director of Information Services for LaHousse-Bartlett Disability Management, dba RehabPlans and ReviewWorks. He lives in Ann Arbor, Michigan. Email him at
LATEST COMMENTS
MC Press Online