I frequently use _Rreadk with a partial key, assuming that the first part is 
known. Never had any problems. Not sure, that what Ulrich writing is correct. 
At least I never did like that. 
_Rreadk definition is as follows:
_RIOFB_T *_Rreadk(_RFILE *fp, void *buf, size_t size, int opts, void *key, int 

You just set "key" variable to your sequence number, "keylen" variable must 
keep partial key length - not the complete one.
"key" variable size is "keylen" - I never made it larger....
Variable "opts" I usually set first to __KEY_EQ and then to __KEY_NEXTEQ.

If you are still in trouble, give some more details...


> -----Original Message-----
> From: Adam Walker [mailto:adamwalker79@xxxxxxxxxxx]
> Sent: Friday, January 07, 2005 12:50 PM
> To: c400-l@xxxxxxxxxxxx
> Subject: [C400-L] using _Rreadk with a partial key - any examples?
> Hi there,
> I am accessing a logical file keyed over the first four 
> fields.  however, I only know the first field of the key that 
> I need to access.  This field is a unique seq number so 
> should be sufficient to locate the correct record, and the 
> documentation for _Rreadk states it can use a partial key, 
> but I am not able to successfully retrieve a record unless I 
> build the complete key (which I can do in test, but not reality).
> Ideally there would be a logical keyed over just the unique 
> seq number, but there isn't and I don't want to add one 
> unless theres no other way.
> Is there anyone out there who has used _Rreadk with a partial 
> key successfully?  would you mind providing an example of how 
> the key was built (compared to a complete key) and the _Rreadk params?
> thanks to anyone who can help,
> - Adam
> ---------------------------------
>  ALL-NEW Yahoo! Messenger - all new features - even more fun!  
> _______________________________________________
> This is the C programming iSeries / AS400 (C400-L) mailing list
> To post a message email: C400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/c400-l
> or email: C400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/c400-l.

This thread ...

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].