Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

In case if I want to know whether a record exists in a file, which one do you prefer CHAIN or a SETLL and why ?

1 Answers  


what is kids-rpg?

0 Answers   IBM,


Can anybody tell me that why we use option(*nodebugio)in H- Spec?

3 Answers  


what is estimation? and what is the level identifier parameter in PF?

3 Answers   TCS,


How can we override a file during runtime in rpg?

0 Answers  


3 members in databasefile .how to read records from all the members??

6 Answers   CTS,


What will happen if we r using seton lr after return or vice versa.

5 Answers  


can any body correct the following code? Following a procedure which returns the maximum of two numbers.Correct the following code. P GETMAX B D GETMAX PI D NUM1 35 0 D NUM2 45 0 C IF NUM1 > NUM2 C RETURN NUM1 C ELSE C RETURN NUM2 C ENDIF P GETMAX E

1 Answers  


1..Write an sql query to find the employee name who is having 2 phone numebr? 2.Write an sql query to the the second highest salary of the employee?

4 Answers  


HOW TO DEBUG A BATCH JOB WHEN IT IS IN MESSAGEWAIT(MSWG) STATUS.I KNOW THE STEPS FOR BATCH DEBUGGING,BUT IM CONFUSING WITH WHEN WE SUBMIT ANY JOB FOR BATCH DEBUG WE PUT IN HELD STATE.SO HERE ALSO DO SAME THING OR ANY OTHER WAY,PLEASE HELP ME....

1 Answers   HCL, Mind Tree,


Thanks gagan for your answer,i'm new to as400,i don't know embedded sql in rpg.can you send me the coding for the below mentioned question in embedded sql rpg. how to retrieve particular field records from a physical file,say i have a physical file called 'employee' in it i have to retrieve the records of a field 'admin' present in pf 'employee' using rpg,but i should not use logical file or openquery file.

2 Answers   iGate,


Write a program to display prime numbers between 1 to 100 using RPGLE.

1 Answers  


Categories