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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between bind by copy and bind by reference?

1736


what is program status data structure?

1395


What is the purpose of record level identifier?

732


Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student in rpg

721


which program rpg or cl is efficent to update a transaction onto a database file and why ?

749






How to handle duplicate error handling in RPG?

1687


can any one help in hawkeye and turnover or any change management system plzzzzz or send the documents to my mail id :gvsp.as4@gmail.com

1973


how do I declare a minor?

718


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.

5429


what is the rpg system?

670


how do I declare a table or array in rpg iv?

740


what is the necessary keyword needed to scroll subfile records?

707


If my rpg program has a date field, what extra care I have to take while compiling that rpg program? If the file is keyed and I have declared the file as well as key list properly in my program. Still am getting an error message like "chain/reade operation is not allowed" what may be the case?

624


how do I play {insert rpg system here}?

589


How to select highest score of each subject or how to select highest income of every month?

1299