220 pts.
 How to use more than one key field in CHAIN opcode
I have a physical file it contains three key fields how to use all three key fields in CHAIN opcode

Software/Hardware used:
ASKED: November 28, 2012  7:25 AM
UPDATED: November 28, 2012  12:40 PM

Answer Wiki:
Use KLIST operation code and define all three key fields there.  Then use KLIST to CHAIN the record.
Last Wiki Answer Submitted:  November 29, 2012  4:38 pm  by  Michael Tidmarsh   11,410 pts.
All Answer Wiki Contributors:  Michael Tidmarsh   11,410 pts. , Cursorposition   195 pts. , gsivakkp86   220 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

From the RPG Reference Manual under the ‘CHAIN’ topic:

If the file is an externally-described file, search-arg can also be a composite key in the form of a KLIST name, a list of values, or %KDS.

So, you can list the key fields in a KLIST, or you can list them in the CHAIN instruction itself, or  you can list them in a key data structure. The language reference manual is where you should find answers for questions like this one.
 
Tom

 108,260 pts.