The most obvious would be the following:

pFeedback = _Rreadk(pFile, pRecBuffer ,nRecLength, __KEY_EQ, pKey->Seq, 4);

Which is exactly the same, as what you did - in this particular case.

Not absolutely sure, what would happen with your program in case seq in the 
your PF is not decimal(7,0) but rather decimal(9,0). 
Because decimal(7,0) occupies 4 bytes. And probably this will be the size of 
your structure SXKey. 
But what will be the size of structure, keeping decimal of size 5 bytes?
Anyway, manual states, that key type is void. For me that means, that is 
treated as void. So I see no reason to send structure to it. As far as my 
experience says, PF do not keep any padding spaces, so probably structures must 
be unaligned (packed).


> -----Original Message-----
> From: Adam Walker [mailto:adamwalker79@xxxxxxxxxxx]
> Sent: Monday, January 10, 2005 12:59 PM
> To: c400-l@xxxxxxxxxxxx
> Subject: RE: [C400-L] using _Rreadk with a partial key - any examples?
> I tried setting the other fields to blank or 0, but no joy.  
> So i've removed those fields from the struct and just kept 
> the seq.  The key length is set to the struct size.  this 
> approach seems to work well.
> thanks for your help guys.
> solution:
> typedef struct {
>  decimal(7,0) seq;     
>  //char sCus[6];
>  //char sCLC[3];
>  //char cPrime;
> } SXKey;
> ....
> ....
>     char* pKeyBuffer = malloc(sizeof(SXKey));
>     SXKey* pKey = (SXKey*) pKeyBuffer;
>     int nKeyLength = sizeof(SXKey);
>     pKey->seq = 28;
> ....
> ....
>     pFeedback = _Rreadk(pFile, 
> pRecBuffer,nRecLength,__KEY_EQ,pKeyBuffer,nKeyLength);
> ---------------------------------
>  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:
> or email: C400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at

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