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

Answers were Sorted based on User's Feedback



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

Answer / prabhas

1. Using DCLF command
2. OVRDBF with Position parameter
DCLF FILE(&FILENAME)

OVRDBF FILE(&FILENAME) POSITION(*KEY 1 FMT2 X'123F')

The system searches for a record from the record format
FMT2.
A single key field is used in the search (even though the
key value may have more key fields).
The record contains the hexadecimal value 123F (the
hexadecimal equivalent of packed decimal value 123.0). You
get this record when it is found.

Is This Answer Correct ?    22 Yes 0 No

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

Answer / 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

More RPG400 Interview Questions

what is the difference between do while and do until?

0 Answers   IBM,


1) How to declare a file? 2) How to define a display file? 3) How to monitor error messages in RPG? 4) How to find the attributes for subfiles? and what is the DDS for subfiles?

2 Answers   TCS,


What is the name of default out queue when user logs inn to syatem with valid profile?

3 Answers   IBM,


Can we journel logical file and access path? Can we use commitment control for non-join L.F?

4 Answers  


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

2 Answers  






we are sending data of physical file to screen design and it is showing no record why?

1 Answers   NTT Data,


What is the difference between RPG/400 and RPG4

1 Answers   HCL,


Can a run time array be declare like below with no specified number of elements ? Is it possible ? DFLD_ARRAY 7 DIM() INZ(*blanks) What does this mean ? Does this mean that the number of array elements will be dynamically declared during run time ?

1 Answers   TCS,


Can any one plz explain the concept of INFSR, *PSSR, INFDS AND PSDS, I' confusing about PSDS and *PSSR, Wat is the difference btw them, wat PSDS will do????

1 Answers  


How to code Page up and Page down in RPG for Single page subfile without using ROLLUP/ROLLDOWN in DSPF ?

3 Answers   HCL,


Can AnyOne tell me how to read join logical file in rpg from starting to end?

2 Answers  


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

2 Answers  


Categories