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...


i have a file with the values 10, 20, 30, 40, if am setll with
the value 25 then readp, so what it will return?

Answers were Sorted based on User's Feedback



i have a file with the values 10, 20, 30, 40, if am setll with the value 25 then readp, so what it..

Answer / kumar

The Answer is 20.
This is the code I tried and the answer is 20

 FEmpLF1    if   E           K Disk                   
 c                   move      25            EMPID    
 C     EMPID         SETLL     Emprec                 
 C                   READp     Emprec                 
 C     *IN80         IFEQ      *OFF                   
 C     EMPID         DSPLY                            
 c                   endif                            
 c                   eval      *INLR = *ON            

Is This Answer Correct ?    8 Yes 0 No

i have a file with the values 10, 20, 30, 40, if am setll with the value 25 then readp, so what it..

Answer / sachin14muthu

Yep Shishir, you are correct. i have tried with the program...

Is This Answer Correct ?    3 Yes 0 No

i have a file with the values 10, 20, 30, 40, if am setll with the value 25 then readp, so what it..

Answer / venkat

SETLL always looks for Equal or Greater value.
in the given entries we don't have 25 so it points to the greater to 25 record which was 30.
here we are using READP so the answer is 20

Is This Answer Correct ?    1 Yes 0 No

i have a file with the values 10, 20, 30, 40, if am setll with the value 25 then readp, so what it..

Answer / thakur

Ladies, don't fight.

Answer is simple:-
If you do setll with 25 and then READP ,program will read last record as SETLL sets pointer using RRN and not field value.

For eg:- To retrieve 2nd record , you have to set pointer at 3rd record and then READP.

Is This Answer Correct ?    1 Yes 3 No

i have a file with the values 10, 20, 30, 40, if am setll with the value 25 then readp, so what it..

Answer / shishir

DEAR ITS REALLY SIMPLE U SHOULD TRY IT ON YOUR OWN:
SUPPOSE EMPNO FIELD IS KEY FIELD OF FILE HAVING RECORD :10,20,30,40
SO WAT HAPPEN READP READ PREVIOUS RECORD AND SETLL SEARCHING DATA THROUGH KEYFIELD
SO AFTER READING RECORD 20 IT GOES TO 30 BUT WE ARE SEARCHING FOR 25 WHICH IS NOT PRESENT SO IT WILL RETURN 20 AND OUTPUT
MEANS IF FIELD HAVING DATA LIKE : 10,20,24,30,40
THEN IN THIS TIME OUTPUT WILL ME 24 OK BYE T.C

Is This Answer Correct ?    6 Yes 9 No

i have a file with the values 10, 20, 30, 40, if am setll with the value 25 then readp, so what it..

Answer / ardeep

If the SETLL operation is not successful (no records found condition), the file is positioned to the end of the file.

10 20 30 40

So when 25 is searched the pointer goes to 40.

And now when READP (Read Previous) is issued it fetches
30.

Answer is 30.


Have Fun :) !!

Is This Answer Correct ?    5 Yes 22 No

Post New Answer

More RPG400 Interview Questions

Can we journel logical file and access path? Can we use commitment control for non-join L.F?

4 Answers  


1.I have a Physical file with 100 records, No duplicates exists, all are Unique,But while i am running Runqry utility i am getting only 80 records..What could be the reason?

3 Answers   Cap Gemini,


when will come session device error?

4 Answers   TCS,


Suppose I have 3 jobs a b and c. I want to submit b after successful completion of a and want to submit c after successful completion of b. Without using job scheduler or job queue, how can I do that through cl program?

1 Answers  


what is file identifier wher we can use

1 Answers   IBM,


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,


Hi,This is raju.Can any body give me the real experience answer for this question? 1.What is the significance of *MAP and *DROP in the CPY command?

3 Answers  


1)how to do date validation in rpg? 2)how to delete dUPLICATE RECORDS?

12 Answers   IBM, Opus,


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

4 Answers   CTS,


Can AnyOne tell me how to read join logical file in rpg from starting to end?

2 Answers  


what is the difference between do while and do until?

0 Answers   IBM,


Errors in Sql query will be in which state?

1 Answers  


Categories