|
Wow - that's a lot of stuff to get wrong :-) Many thanks everyone, I now have a fix, a thorough explanation of why it was broken, and a different way of doing it that I hadn't thought of. Once again the list proves to be worth it's weight in gold. Robin -----Original Message----- From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com] On Behalf Of Buck Calabro Sent: 17 June 2002 19:13 To: rpg400-l@midrange.com Subject: RE: Problem with QWDRSBSD retrieve subsystem information API - long message The main thing to remember is that manual reference to Binary(4) means a 4 byte binary number. In RPG that would be 10i 0. Something that tends to confuse people is the difference between positional notation D ERRPRV 1 4B 0 INZ(96) and length notation D APILEN 4B 0 INZ(0) These two fields are NOT the same length, and do NOT occupy the same number of bytes of storage. With positional notation, you specify the number of bytes the field will occupy. ERRPRV occupies 4 bytes. With length notation, you specify how many digits the field is. APILEN occupies 2 bytes. Do note that the older "B" datatype will truncate large numbers. Generally, for 0 decimal numbers I would always use the newer "I" (integer) data type instead. So ERRPRV is equivalent to 10i 0, while APILEN is equivalent to 5i 0. Because APILEN is too short, QWDRSBSD is reading two extra bytes of storage (probably the "SB" from "SBSI0100" and interpreting them as part of the length variable. So it thinks ot can write on much more storage than it actually should. --buck
As an Amazon Associate we earn from qualifying purchases.
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.