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

How do you proceed in case your active AS400 session has got disconnected suddenly, how can you get back to your session ? Is it possible??

1 Answers  


if there is pf in two libraries and there is a logical file based on the PF, how to find the pf on which the pf is based.

2 Answers   TCS,


How to print output from openquery in as400 ?

1 Answers   Four soft,


i have 6 char field in program, but this field is using in all files i want to chage field size as 10 char , how can i do this except using *like defn...?

1 Answers   IBM,


Can you copy the records created by the OPNQRYF to other files and how?

2 Answers  


i hav 2 logical files(L1,L2) both r derived from one physical file(P1). how can i use both the logical files in one RPG program? if yes what i have to d.

5 Answers   TCS,


what is commitment control?explain about it?

1 Answers   HSBC,


Anyone help me for the below question:- If problem/error occur in *PSSR subroutine,how should I handel it in RPG program.

1 Answers  


what is use of sflnxtchg and use of MDT(modify data tag).both r same r not and can we use these on dspf and subfile.

2 Answers  


How to index LF by relative record no (RRN)

1 Answers  


How can read PF in reverse order (end to start) in CL pgm..

8 Answers   TCS,


If record-format name in an externally-described file has already been defined as a file-name.how to solve this?

2 Answers   CTS,


Categories