%KDS(data-structure-name{:num-keys})
%KDS is allowed as the search argument for any keyed Input/Output operation (CHAIN, DELETE, READE, READPE, SETGT, SETLL) coded in a free-form group. The search argument is specified by the subfields of the data structure name coded as the first argument of the built-in function. The key data structure may be (but is not limited to), an externally described data structure with keyword EXTNAME(...:*KEY) or LIKEREC(...:*KEY)..
Example:
A..........T.Name++++++RLen++TDpB......Functions++++++++++++++++++
A R CUSTR
A NAME 100A
A ZIP 10A
A ADDR 100A
A K NAME
A K ZIP
FFilename++IPEASF.....L.....A.Device+.Keywords+++++++++++++++++++++++++
Fcustfile if e k disk rename(CUSTR:custRec)
DName+++++++++++ETDsFrom+++To/L+++IDc.Keywords+++++++++++++++++++++++++
D custRecKeys ds likerec(custRec : *key)
...
/free
// custRecKeys is a qualified data structure
custRecKeys.name = customer;
custRecKeys.zip = zipcode;
// the *KEY data structure is used as the search argument for CHAIN
chain %kds(custRecKeys) custRec;
/end-free