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

what is edit word and edit code

0 Answers   Cap Gemini,


What is use of IMPORT and EXPORT in RPGLE ? What is activation Group ? What is Service Program ???? How to call another program in RPGLE ?

1 Answers  


in which journalling which attributes are necessary

2 Answers   CTS,


what is program status data structure?

1 Answers   IBM,


difference betwen keywords and opcodes

3 Answers  






please help me answer to this question what is the difference between the binding and srvpgm in ilerpg?

4 Answers   HCL,


HI,1: What is the function of 'SETON LR' AND '*INLR=*ON ? 2:Can we used "seton lr" OR "*INLR = *ON" in between the program code ? 3:if yes then according to there function the code which is written acter seton lr/ *inlr should not be execute . Can any one tell me why those code get executed ?

2 Answers  


1.I have a Physical file with 100 records, No duplicates exists, all are Unique,But while i am running Runqry utility i am getting only 80 records..What could be the reason?

3 Answers   Cap Gemini,


Can we have a Physical file without any member ? Please let me know

12 Answers  


How do I link an existing logical file to it's Physical File without recompiling?

2 Answers  


How to set on/off a group of indicators in a single statement?

3 Answers  


When PGMA calls PGMB for the first time PGMB executes the *INZSR. PGMB uses the RETRN operation to return to PGMA. When PGMA call PGMB the second time is the *INZSR executed?

5 Answers   Mphasis,


Categories