Hi Scott,

Here's how the keys are defined:

key1 INTEGER NOT NULL ,
key2 INTEGER NOT NULL ,
key3 CHAR(2) CCSID 278 NOT NULL ,


2008/7/29 Scott Klement <c400-l@xxxxxxxxxxxxxxxx>

Are you certain that the keys in your file are integers?


Olsson Erik wrote:
I'm trying to read an index with Rreadk, but I keep getting no bytes in
return. The record exists and the values looks ok to me in debug. Anybode
see what I'm missing?

typedef struct {
int key1;
int key2;
char key3[2];
} mykey;

mykey keyflds;
mykey *inkey;

//file opening etc, and then...
if ((fp=_Ropen("*LIBL/MYINDEX", "rr, riofb=N")) == NULL)
return -1;

keyflds.key1 = 1000;
keyflds.key2 = 233924;
memset(keyflds.key3, ' ', sizeof(keyflds.key3);
memcpy(keyflds.key3, "CA", 2);

inkey = &keyflds;

fb = _Rreadk(fp, &buf, sizeof(buf), __KEY_EQ, inkey, 10);

Best wishes,
Erik

--
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 ...

Replies:

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].