Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


I know chain keyword retreive records randomly but how chain
keyword exactly works internally????

Answers were Sorted based on User's Feedback



I know chain keyword retreive records randomly but how chain keyword exactly works internally????..

Answer / aditya

hello ,
see chain opcode locks the first record of pf and then
starts reading.it is useful when there are multiple
receivers present in your program and you want any specific
receiver.
it is always used with HIGH indicator.

Is This Answer Correct ?    5 Yes 0 No

I know chain keyword retreive records randomly but how chain keyword exactly works internally????..

Answer / drew

CHAIN:
positions current record to correct record based on key
sets HI indicator *ON if position fails and sets %found()
off in free-form code
reads the record fields into the automatic internal buffer
fields
locks the record, if in update mode and "no lock" has not
been added to the command ( chain(n))

Is This Answer Correct ?    1 Yes 0 No

I know chain keyword retreive records randomly but how chain keyword exactly works internally????..

Answer / sandy

chain op code firstly set the file pointer to BOF(begin of file).then look for key or rrn which is specified in factor 1.
in rpg400 EX:
 Factor1          opcode        factor2                    Key/rrn           chain       file name/record format name

Is This Answer Correct ?    1 Yes 0 No

I know chain keyword retreive records randomly but how chain keyword exactly works internally????..

Answer / nkumar

With chain High indicator is defined which will be set on if record is not found. Chain works exactly like SETLL and then READ record. If the record is found it will be read and indicator will be OFF and if record is not found then indicator will be ON.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer



More RPG400 Interview Questions

1.I have a Batch job, Running for 4 hours, i want to reduce the executing time to 2 hours what should you do?

5 Answers   Cap Gemini,


what is a rpg?

0 Answers   IBM,


What is the RPG cycle?

3 Answers   CSC,


How do you find whether a record is locked or not?

2 Answers  


How can you determine the number of characters in a variable?

2 Answers  






How do I read records from Subfile? what is the purpose of READC explain with example?

4 Answers   IBM,


Hi friends, I am using a load all subfile , and currently i am in in the third page of the subfile , from third page i have selected a record and called some other program .on returning, subfile is being loaded from the frist page. so can any one kindly suggest me in retaining my third page after returning. i.e loading from third page.

7 Answers  


how can we know running job is batch or intractive ? i need all the possibilites.........plz help me

3 Answers   HSBC, IBM,


How would display prime numbers using CL program?

0 Answers   Hexaware,


What is the difference between ITER and DO ? I know both are used to execute set of statements repeatedly, but what is the main difference?

2 Answers   CGI, Wipro,


When PGMA calls PGMB for the first time PGMB executes the *INZSR. PGMB uses the RETRN operation to return to PGMA. When PGMA call PGMB the second time is the *INZSR executed?

5 Answers   Mphasis,


this is rpg3 code W0RTN IFEQ @CN,002 what is the means @CN,002

1 Answers  






Categories