bobdylan75
asked on
how does CHAIN statment work? rpgle as400
Hi,
How does CHAIN work?
in particular, if I have 10 records: 1,2,3,4,..,10
if I have just read the 10th record (10).
if I execute this statment:2 chain file
Does the program auto-return to the top of the file in order
to find my 2th record,
or instead it returns NOT FOUND value??
thanks
How does CHAIN work?
in particular, if I have 10 records: 1,2,3,4,..,10
if I have just read the 10th record (10).
if I execute this statment:2 chain file
Does the program auto-return to the top of the file in order
to find my 2th record,
or instead it returns NOT FOUND value??
thanks
Hi
chain gets the a rcord basewd on the index on the file along with other criteria.
It return a single record.
if you have the 10 recors in an indexed file
chain 2 will reset the pointer, if you then did a read you would ger record 3.
Dave
chain gets the a rcord basewd on the index on the file along with other criteria.
It return a single record.
if you have the 10 recors in an indexed file
chain 2 will reset the pointer, if you then did a read you would ger record 3.
Dave
ASKER
SORRY,
I don't mean 2, but the key=2 like the value of the 2th record.
eval key= 2
key chain filename
the key of the file if the field VALUE. (1,2,3,..10)
I don't mean 2, but the key=2 like the value of the 2th record.
eval key= 2
key chain filename
the key of the file if the field VALUE. (1,2,3,..10)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you very clear explanation.
ASKER
the key is obviously the only field I have, the value 1,2,3..10
thanks