


My qn was how to read all members one bye one.
It can depend on the version of your OS. Please provide some info on your environment.
CL can read the records from the output file that Phil mentions. You can also use the RTVMBRD command to retrieve member names one at a time. The RTVMBRD command avoids needing to read the DSPFD output file. (You could also use the List Database File Members (QUSLMBR) API to list members in a user space.)
From i 6.1 on, you can do it easier in a single program. If you need to do it in CL earlier than i 6.1, it requires at least two CL programs.
Tom
Hi Satheesh,
its not possible to open and close the members one by one. suppose if file have 25 members, its inappropriate. There should be some other method which reads each members and checks.
Renjith


we can do in RPG…
just you declare your file in F spec like this…
here find age 50 from one member… after again open another member and field age 50..
you can open member one by one and read it,
And, check age=50…
eval var1=’MBR1′
open pfname
read pfname
if age=50
dsply age
endif
close pfname
eval var1=’MBR2′
open pfname
read pfname
if age=50
dsply age
endif
close pfname
do like this…….. it ll work… you check it one more time…
In CL, have you tried using OVRDBF command, for overriding the Database file to Read records from particular member only.
Once, you done with the required operations, you can use ENDOVR.
And, Override with other Member(if required).
Pradeep.
Hi Pradeep,
can you tell, how to access each members differently in CL.
If possible can u show mw some sample codes?
Renjith
Please help on this
Please help on this
What help is needed? An appropriate answer has been given by Pradeep. Use the OVRDBF command to set any member name that you want to read from.
Tom
My qn was how to read all members one bye one. Hardcoding doesnot work in this case
Have a CL create a member list using the command:
DSPFD MyLib/MyFile Type(*MBRLIST) OUTPUT(*outfile) Outfile(mylib/myOutFile)
F pfname if e disk usropn extmbr(MLNAME )
F Outfile if e disk
The rpg reads each row from outfile — MLNAME is a field in outfile
Then opens pfname and uses it
Closes pfname
loops to read another row from outfile
2 CL’s yes. if one of the cl’s needs to read the outfile
If CL throws the outfile and then calls the RPG IV program
The RPG program can read the outfile and use the extmbr to get the member names and in the one call processes all the members in the file then just 1 cl.
Phil
Thanks Philip and Tom