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 |
Why there is invention of RPG if we can do insert update delete in CL through SQL.Why the rise of RPG?
ESCAPE message sent by child program can be handled by parent program using which keyword?
can anybody help me that what is the procedure of debugging the service program?
How can we access Interactive job LDA in Batch Job?. and How we can access a file in interactive QTEMP lib in Batch job?.
How to find d key field of a pf that doesn’t have source physical file?
am 2010 passed out . can any one tell me which course is good to put 2+fake .guide me
what is the difference between SETON RT & RETURN?
How can we call CL program to RPG? How many number of parameter we can pass
1. If there are two programs using same file and 2 users are using the file at the same time and what can be done to allow them both to access? 2. How can remove lock from the file for accessing it by both users?
what is an online rpg?
What is the OPEN and CLOSE accesspath?
You have a *USE authority on a Library and *All authority on a file in that Library.Can you change the data in that file?