× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




On 18/01/2007, at 12:56 AM, GKern@xxxxxxxxxxxxxxxx wrote:

I tried your suggestion and still got the same results - a single 64k
message.

Then you're not doing it properly. The VARYING variable *WILL* be set correctly using %TRIMR(fixed-variable). The fact that you get more data written to the file is a coding defect in your code probably caused by what values you specify on the write operation.

I also notice that there are two bytes prefixed to the data. I assume
those are the bytes that indicate the actual length of the data. I also
need to prevent that data from being prefixed to the actual data.

These two bytes are the length of the varying data. If you examine these bytes in hex you can verify the length of the data is correct after the %TRIMR populates the variable.

If these bytes are being written into the data it's because that's what your code is telling the system to do. You're probably using IFS APIs and are providing the wrong length for the data and the wrong starting address for the data.

If you don't want these length bytes then specify a starting position AFTER them. That is 2 bytes after the variable start. The length of the data should be the %LEN() of the varying field. You're probably specifying the %SIZE of some other length value. That's what's causing the wrong data to be written.

If you're writing a varying length buffer and you already have the length available why are you using a VARYING variable. Seems very backwards to me.

Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         OS/400, i5/OS Technical Specialists

   http://www.flybynight.com.au/
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\
   Fax:   +61 3 9419 0175                                   \ /
                                                             X
                 ASCII Ribbon campaign against HTML E-Mail  / \
--------------------------------------------------------------------



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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

This mailing list archive is Copyright 1997-2024 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].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.