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

what is the necessary keyword needed to scroll subfile records?

0 Answers   IBM,


I have a file .In that file i have 3 fields. Those fields are eno, ename, esal.Keyfield is eno. In that file i have data like this for eno 1,2,3,4,5. Now i need to display 2nd record. That means i need to set the pointer on 2nd record... Then, write the complete rpg program using setll.

1 Answers  


How do you do indexing in a physical file?

2 Answers  


Can someone tell me tell me what is meant by message wait...?

1 Answers  


can anyone explain aboutovrOVRDBF,OPNQRYF, OVRSCOPE and OPNSCOPE?

2 Answers   TCS,






1.CA(command Atention key)& CF(command Function key) difference with example?Please can any body tell me in real time exp? 2.Can any body tell me some mandatery function keys using while creating any screen with use of SDA-FUNCTION kEYS?

5 Answers   HCL,


What will be your approach in going either for OPNQRYF or Logical files. Which one to go for?

2 Answers  


Program to read marks of 10 students for 4 subjects and compute and display total marks and status of each student in rpg

0 Answers  


what r drawbacks of OPM? Why do we go for ILE RPG?

1 Answers  


How to get only unique records from a file which contains duplicate data using CPYF command ? Example : FILEA has duplicate records and FILEB is a UNIQUE defined.... and I want to get the data from FILEA to FILEB by eliminating all the duplicate records...

2 Answers  


wat is meant by hidden field , why it is used?

4 Answers   Four soft,


there is any limit to display the members in rpg400?

3 Answers  


Categories