difference between CHAIN and READE?
Answers were Sorted based on User's Feedback
Answer / sairam
Using Chain we can set the pointer to the particular record
according the criteria specified in the chain operation. But
in this case, if the record is found then the pointer will
be set, otherwise i.e., if the record does not exist then
the pointer will not set. This is the reason why we check
with the %Found keyword. And moreover after reading the
record (in case if the record found and there are more
number of records with the same keyword), we can not move
to the another record, which meets the same criteria
specified in the Chain operation. So the conclusion is we
can not read more number of records with the Chain
operation, if there are more number of records exist with
the same criteria in the file.
Where as using READE, we can read all the records which meet
the same criteria using subsequent READE operation. If there
are no records with the specified criteria then the pointer
will be set to EOF.
Is This Answer Correct ? | 70 Yes | 5 No |
Answer / shikha
The CHAIN operation retrieves a record from a full
procedural file, sets a record identifying indicator on and
places the data from the record into the
input fields.If a file name is specified in name and access
is by key, the CHAIN operation retrieves the first record
that matches the search argument.
The READE operation retrieves the next sequential record
from a full procedural file if the key of the record
matches the search argument. If the key of the record does
not match the search argument, an EOF condition occurs, and
the record is not returned to
the program. If a READE operation is not successful, you
must reposition the file: for example,
using a CHAIN, SETGT, or SETLL operation.
Is This Answer Correct ? | 8 Yes | 1 No |
Answer / remya
chain-This file operation is used to randomly retrieve a
record from a file.The factor 1 value is mandatory for chain
operation. The factor 1 value must be key field or RRN.Chain
operation=setll+reade. In the case of chain it will points
to a particular record, not store the value in the input
buffer.it will not read duplicate records.if the value not
found the "hi" indicator will turn on.
Reade-Reads equal records from a file when we use setll or
setgt.Reade operation alone will not work.In the case of
Setll+reade, the record will be pointed and store the value
in the input buffer.Then read equal records from a file
sequentially. it will read all the duplicate records. The
factor 1 value is not mandatory for reade,if used,the key
value must be in factor1.
Is This Answer Correct ? | 8 Yes | 2 No |
Answer / mohan
reade--read the equal recd when u use setll or setgt
chain--used to get the rcd random sequenc
by using chain we can lock the recd and unlock the
rcd
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / chandu
simply say one word
chain = set the cursor give equal record
reade = set the cursor give duplicate records also
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / viney
chain is a combination of setll+read... dat is both pointer
is set on lower limit and then file is read.. dnt need 2
give different command 4 pointer set and read...
whereas reade will read d file sequentially at pointer set
2 value equal 2 reade.... in dis pointer can b set 2 a
specified/desired value but in chain by default pointer is
set at lower limit
Is This Answer Correct ? | 3 Yes | 4 No |
Answer / vivek
Chain is used for random retrieval from a file basically
CHAIN=SETLL+READ
READE sequentially reads the next record in a full
procedural file if the key of that record matches the value
in factor 1 in read equal no pointer sets but in Chain
pointer sets on lower limit
Is This Answer Correct ? | 7 Yes | 13 No |
Some times While checking MSGW for object / member / record locks ,I have seen it's locked by itself ...? How it happen and what action we need to perform if job is updating / writing a record....?
1.WHAT IS WRONG WITH THE CODE BELOW? C CUSTNO CHAIN CUSTMAST IF %ERROR can any body find the wrong please? 2.What builtin function will you use to achieve the following functionality? C QTY IFLT *ZERO C QTY MULT-1 QTY ENDIF
A particular job executing on the iS is not behaving as expected and is operating in an environment in which it can be debugged. What commands would you use to debug and observe the program?
in which journalling which attributes are necessary??/
1. If there are two programs using same file and 2 users are using the file at the same time and what can be done to allow them both to access? 2. How can remove lock from the file for accessing it by both users?
IN RLU what are the record level keyword is used?
RETRIVING DELETED RECORDS :- I'm frequently asked how to retrieve deleted records from an unjournaled physical file when the deleted records have not yet been removed from the file. Utility UNDEL lets you undelete records in a physical file. This public domain program is available in CISC and RISC versions, and the complete source code is available for download at: UNDEL for AS/400 Save File (RISC): http://www.as400network.com/sharewarefiles/undelris.zip UNDEL for AS/400 Save File (CISC): http://www.as400network.com/sharewarefiles/undel.zip UNDEL for AS/400 Save File (Source code): http://www.as400network.com/sharewarefiles/undelsrc.zip The utility takes advantage of the fact that deleted records in physical files are only flagged as deleted, and the record data still exists until it is overwritten or the file is reorganized with a utility such as RGZPFM. UNDEL simply reads the deleted record, then reuses the record by writing over it with the new record (thus eliminating the flag for the deleted record). Some homegrown and commercial utilities copy the file containing undeleted records to a save file, then use a program to read the save file, which contains live and undeleted records, to a file to undelete the records. The UNDEL utility is superior to the SAVF technique because there's no need to copy the file to a save file, which is especially important for really large files. When run, UNDEL displays the physical file records in their unformatted, raw text form. You can either position the display to a given relative record number or use F19 or F20 to find the previous and next deleted record, respectively. The utility also includes online help, which is almost unheard of for free utilities. Other utilities include the ability to undelete records. You can use the RTVDLTRCD command in the old QUSRTOOL (no longer supported by IBM). QUSRTOOL is now a commercial product called TAA Productivity Tools ( http://www.taatool.com ). The free file editor WRKDBF has a built-in undelete capability ( http://www.wrkdbf.com ), and several commercial file editors can undelete records. For a complete list of file editors, go to http://www.sourcebook400.com, select "Programmer Tools" under "Product Category," then select "File Editors."
Can AnyOne tell me how to read join logical file in rpg from starting to end?
What is SFLNXTCHG keyword why it has used and where? Briefly explain with Example.
steps for debugging two rpg programs????
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.
what are the array operations?