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

how can an indexed file be used as arrival sequence in RPG?

3 Answers   IBM,


How can you determine the number of characters in a variable?

3 Answers  


how do u find whether a record is locked or not??/

5 Answers   CTS,


What are the types of identifiers?

0 Answers  


How to get only unique records from a file which contains duplicate data using CPYF command ? Example : FILEA has duplicate records and FILEB is a UNIQUE defined.... and I want to get the data from FILEA to FILEB by eliminating all the duplicate records...

1 Answers  






in which journalling which attributes are necessary

2 Answers   CTS,


How to sort an array in descending in RPG

3 Answers   Google, TCS,


Let?s consider a variable X of length 20. Move value ?ABC? to it.How to determine how many characters does X have?

1 Answers  


Can someone tell me tell me what is meant by message wait...?

1 Answers  


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  


Difference between creating a report using Printer file and WRKQRY(Query Report) ?

3 Answers  


two types of read performed in dataqueue?????

4 Answers   CTS,


Categories