I know chain keyword retreive records randomly but how chain
keyword exactly works internally????
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Hi, I am getting the error in RPG (All Record Formats for externally-described file ABCD ignored or dropped due to error; file ignored.) Please suggest any
What is difference between bind by copy and bind by reference?
What is a record lock error?
what is meant by record lock.how records are locked.what is the purpose of record lock.if records are locked what happens.how to find out which record is locked.
How can we know running job is batch or interactive?
What is the purpose of PUTOVR keyword?
I want to add 10 days in current date. how it is possible in CL program...?
can anybody help me to solve this problem. the program that i m checking display error message saying "Record format for file AJDSPFFD does not match model file and decimal error. how to solve this problem. The AJDSPFFD is snapshot the AJTLOG that is the audit trail list.
steps involved in debugging and types of debugging modes?
How do you find whether a job is a batch job or interactive?
i have 1000 records in pf.what are all the ways to read a particular name records in rpg?? ie.. in pf i have a name called demo appeared around 52 times hw will we read this particular records in rpg/400?.
How to code Page up and Page down in RPG for Single page subfile without using ROLLUP/ROLLDOWN in DSPF ?