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
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 |
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 |
can i use unique key in LF
Difference between creating a report using Printer file and WRKQRY(Query Report) ?
what do you mean by SESSION/DEVOCE ERROR?
what is file information data structure?
Explain mdt?
I am reading a file in CL program. and MONMSG CPF0864 has arrived means EOF has arrived. Now i want to read this file again. How i can do this?
5 Answers CitiGroup, Symphony,
what is meant by record lock.how records are locked.what is the purpose of record lock.if records are locked what happens.how to find out which record is locked.
what is *place and *auto keyword in prtf ?plz explain
when will come session device error?
How many program bind in one module....
1.I Have a physical file , i want to read the data from the each and every member of the File in the CL Program.How do you achieve this. 2.How do you do the same in RPG?. do think is it possible to read data from all the members in the RPG?
what is the necessary command needed before OPNQRYF and why?