How can we read a particular record from the database file
which is not having DDS (Flat File). For example, there are
100 records in the flat file. How can we retrive 15th
record in RPG/400 program (Without using CL)

Answers were Sorted based on User's Feedback



How can we read a particular record from the database file which is not having DDS (Flat File). Fo..

Answer / swetha p rao

Yes ,Using RRN of the file we can retrive.

Chain the file with RRN or Query the file with RRN
select * from temp33 where RRN(temp33) = 15

Is This Answer Correct ?    15 Yes 0 No

How can we read a particular record from the database file which is not having DDS (Flat File). Fo..

Answer / pravin

there are too many ways-
1. declare that flat file as a edf in pgm and rename the
rcd-format and field name than set the pointer on 15 record
by setll and then read it.
2. define a per-run time array with fromfile(name of flate
file). then see th2 arrays 15 index value.

this are two methods. i have 2 more methods also
if any one want's contact me on pravin_cse1@yahoo.com

Is This Answer Correct ?    4 Yes 1 No

How can we read a particular record from the database file which is not having DDS (Flat File). Fo..

Answer / prince

My Answer is below
We need to use the following.

Factor 1 = 15
Opcode = CHAIN
Fator 2 = File Name


Please correct me if I am wrong

Is This Answer Correct ?    10 Yes 9 No

How can we read a particular record from the database file which is not having DDS (Flat File). Fo..

Answer / swetha

I think you can use setll only if the file has keyfield

Is This Answer Correct ?    4 Yes 7 No

How can we read a particular record from the database file which is not having DDS (Flat File). Fo..

Answer / kamal

EVAL EMPID=15
EVAL=%FOUND(PF NAME)
READ PFNAME
EMPID DSPLY

Is This Answer Correct ?    0 Yes 3 No

How can we read a particular record from the database file which is not having DDS (Flat File). Fo..

Answer / kkk

ithink
using setll
factor1 setll pfname

Is This Answer Correct ?    1 Yes 4 No

Post New Answer

More RPG400 Interview Questions

i hav 2 logical files(L1,L2) both r derived from one physical file(P1). how can i use both the logical files in one RPG program? if yes what i have to d.

5 Answers   TCS,


while i am using the dspmsg command on comman line in Mocha am getting error like Not authorized to message queue message my messagequeue Name? can anybody help me how to change my message queue Am anable to see my messages in message queue

1 Answers  


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,


wat is scan and check ? give me real time scenarios where we used these keywords in ur projects?

2 Answers   Four soft,


i have 1000 records in pf.what are all the ways to read a particular name records in rpg?? ie.. in pf i have a name called demo appeared around 52 times hw will we read this particular records in rpg/400?.

11 Answers   IBM,


what is the difference between do while and do until?

0 Answers   IBM,


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

4 Answers  


I have a PF(ABC)with no key fields. PF(ABC)have 2 fields (cusno and cusname). Please let me know how can i read the cusno = 1150 directly from PF in CL and RPG program(Without creating the LF and without reading the complete file and then compare 1150)

3 Answers   Opus,


parameters cannot be passed in which one???

4 Answers   CTS,


is this a rpg channel?

0 Answers   IBM,


Job is in MSGW while reading the input file and writing a new record / updating a reacod due to Duplicate data error. What action would you take ( C D I R )...?

4 Answers  


If record-format name in an externally-described file has already been defined as a file-name.how to solve this?

2 Answers   CTS,


Categories