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

How would display prime numbers using CL program?

5679


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?

618


How to create a login screen using a command instead of display file.... intention is to get a password field on a command..... how do you achieve this...

1311


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

1730


When it is desirable to describe files Internally?

1188






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

1295


How can we override a file during runtime in rpg?

688


is this a rpg channel?

681


what was the robotech rpg?

684


thanks mr.Harshad R Suryawaunshi,i'm new to as400 i think you are telling in rpgile i know only rpg400 if possible can you tell in rpg400

1895


can anybody help me to solve this problem. the program that i m checking display error message saying "Record format for file AJDSPFFD does not match model file and decimal error. how to solve this problem. The AJDSPFFD is snapshot the AJTLOG that is the audit trail list.

2278


how do you use commitment control in rpg?

757


what is an online rpg?

725


We have job which is running as batch. It takes atleast 06 hours to complete tht job. But I wanna do tht job with in 3 hours?

768


How Chain operation copies the record's data to the input buffer for the program?

1082