1) How to define keyed file in CL pgm.
2) How can i read particular records in CL pgm from
database file.

Answer Posted / svankipu

See
1. In DCLF command u can declare a keyed-PF or an LF(having
desired keys)

2. In OVRDBF command u have an attribute called KEYFLD,
wherein u can mention the key-field of the above file.

Then you can use POSDBF command to position the PF or LF &
read it using RCVF command.
That's it!

Is This Answer Correct ?    5 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

1. What is bound-by-call and bound-by-reference? 2. Where and why is *Nomain used? 3. What are the difficulties faced by programmers when using service programs? 4. Explain the different ways of parsing and compiling XML in iSeries.

5407


how do I play {insert rpg system here}?

585


How do u design a physical file, when you have 2 Unique fields like for eg in A student file student ID and student examination no both are unique

548


What is the difference between iter and do?

676


How to write record if no field or the field are different in physical file in rpgle ?

490






What is the difference between copybooks and subprocedures in as400?

808


What is a record lock error?

1265


Explain mdt?

665


what is the use of sflnxtchg?

803


When we have a file with Duplicate records and I want to read the unique record from the file. For example a file containing Emp Name as 'Ram' and there are 3 entries of it. So how to read a unique record from File?

509


What are the types of identifiers?

572


how can I tell when to replace the array?

702


Suppose we have one database file and it is used by 5 programs and in 3 program we have to add some records in datbase file s what is the impact on other program?

1455


How to define data area in RPG program? In which scenario multi occurrence DS is use in AS400?

1561


How can we know running job is batch or interactive?

656