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

Why we need to give File and To file Names While we are using OVRDBF. What is your understanding related to this?

2 Answers   Cap Gemini,


How to update physical file in rpgle without using display file?

4 Answers   GalaxE, IBM, TCS,


I have file with data as follows data 1 2 3 4 5 I need to read 1 and 5 ,then 2 and 4 then like.. upto end of file, can any one help on this

3 Answers   ISG,


what is batch debug in as400?

3 Answers  


what is flat file?

1 Answers   IBM,


How to find d key field of a pf that doesn’t have source physical file?

2 Answers  


how many variables can we declare in cl pgm?

13 Answers  


what is difference between DSPFD and DSPFFD?please give me real senario with good example?

1 Answers  


Assume my file has 100 records and I want to see only first 10 records. Is this possible through lf?

1 Answers  


how we retrieve records without using key field (ex:name) from Physical File through RPG in as/400?

8 Answers  


How to identify the object has compiled with the debug view as *source without using STRDBG?

6 Answers  


i'm working on progA , in that program i want to see the userids of the users who work on this program?

10 Answers   Four soft,


Categories