How to read data from Nth member of a physical file containing
some X number of members in it?
"Provided member names are unknown"

Answers were Sorted based on User's Feedback



How to read data from Nth member of a physical file containing some X number of members in it? &..

Answer / sandey243

Way:1
We can execute DSPFD with *OUTFILE option, using QCMDEXC in
RPGLE program then we can read the outfile to get the name
of the file, then after we can read the file.

Way2:
Make the file to have all members available i.e.,
EXTMBR(*ALL). Then move *HIVAL to RRN and do a SETGT on the
file... this will take the control to the bottom of the
first member...then READ will give you first record of the
Second member...... This way we can go to the member....
(This method I tried and succeeded)...

Is This Answer Correct ?    10 Yes 1 No

How to read data from Nth member of a physical file containing some X number of members in it? &..

Answer / deva

using EXTMBR

Is This Answer Correct ?    1 Yes 1 No

How to read data from Nth member of a physical file containing some X number of members in it? &..

Answer / zavith ahamed

to declare f spec extmbr(*all) to read the  data from file

Is This Answer Correct ?    0 Yes 1 No

How to read data from Nth member of a physical file containing some X number of members in it? &..

Answer / sakshi bansal

I tthink we can use OVRDBF command in Cl and call RPG through it.

Is This Answer Correct ?    0 Yes 5 No

Post New Answer

More RPG400 Interview Questions

what is the rpg system?

0 Answers   IBM,


Hi all friend, Could Any body send me the code (with coding) of this senario because I have tried but I am stucking somewhere so Please reply ASAp with coding. senario:Q: I have to write the flat file(FLAT1) into the three different PFS (PF1,PF2 and PF3) with the respect of H line data, D line data and Z line data of flat file. where I have different data in flat file(FLAT1) which is mentioned below with data. H0929200909282009092820095529420003000073 D2222220006765555webservi001633.9909222009092820090924200951 8564380134049ROSNER TOYOTA OF FREDE FREDERICKSBURVA 224080000USA840840001633.99001633.99851856492689800208001915 511001633.990408490000000.0000000003446048 1,3 110793145 09070700351 372367 Rosner Motors D3333320006774444webservi000271.2409222009092820090924200951 8564380134049ROSNER TOYOTA OF FREDE FREDERICKSBURVA 224080000USA840840000271.24000271.24851856492689800208001835 511000271.240930680000000.0000000003450293 1 110793254 09072100079 373933 Rosner Motors Z0929200900000020001905.25 FLAT1 has the three pf data H line-represents the header pf data,D-Represent Details pf data,Z-Represents the trailer pf data Now I have to write H line data of flat file into Header pf (PF1),D line data of flat into datails pf(PF2) and Z line data of flat file into pf(PF3) with the spefic position(H,D and Z data of flat file into PF1, PF2 and PF3) of flat file.

4 Answers   IBM,


The PGMA calls PGMB.PGMB generates a report.The report should contain the called program name(PGMA).How do i get the called program name in PGMB to print it on the spool file?(calling program name should NOT be hard coded or passed as parameter to called program?

6 Answers  


Why Rpg/400 is Famous?

2 Answers   IBM,


How I can reread the physical file in CL program once the end of file reached in same CL program.

20 Answers   IBM,






WHAT IS MENT BY RECORD LEVEL IDENTIFIER ? WHAT IS THE PURPOSE OF THIS?

1 Answers  


What is a record lock error?

0 Answers   Wipro,


How can read PF in reverse order (end to start) in CL pgm..

8 Answers   TCS,


I want my simple Green screen should refersh every 1 min ,How can I do it..? Please share the logic

2 Answers  


suppose if we want to update the data in cl what we will do?

9 Answers  


can you debug ile rpg program using isdb?

0 Answers   IBM,


How can we override a file during runtime in rpg?

0 Answers  


Categories