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

two attributes which govern the excecution of a job>>>>??

2 Answers   CTS,


what is file information data structure?

1 Answers   IBM,


wat is curser?? and its types???

4 Answers   HSBC,


Can anybody tell me the setps to create .csv file in IFS folder on AS/400. I also need to know how I can send this .csv file to PC in xls sheet.....?

2 Answers  


RPG/400 number of Records present in a physical file using file information data structure FPF001 IP E DISK F KINFDS INFDS1 IINFDS1 DS I *RECORD RECORD Is this coding correct sir,i have given I P E that is I- input,P-primary file,E-externally described. Primary to use RPG logic cycle,is this the correct method because we have to find number of records present using file information data structure in RPG/400 without doing any input/output operations on the file and also without using DSPFD,SQL. If the above coding is correct means,when i compile the program it gets compiled,but if i call the program it does not return anything,i need number of records,please complete the coding sir.

1 Answers   IBM,






How can we know running job is batch or interactive?

0 Answers  


suppose if we want to update the data in cl what we will do?

9 Answers  


When we have a file with Duplicate records and I want to read the unique record from the file. For example a file containing Emp Name as 'Ram' and there are 3 entries of it. So how to read a unique record from File?

0 Answers  


program to find the number of objects used in a given program through a display.

2 Answers   IBM,


can anyone say,what is the use of operation extended H/N/P?

2 Answers  


What is the length of Signature?

3 Answers   UST,


What is a record lock error?

0 Answers   Wipro,


Categories