|
>> You've gotta be joking me! Nope - that's pretty much it. Forget parameters and just take simple case of a field stored in a DS as type B. Note I'm using "type" because I and U are also binary. To multiply your field by another (assume packed) the compiler will generate: Move field to packed temp Multiply temp by second value Move packed result to binary field. This does not happen for types I and U. Basic reason is that a B type is defined as having a specific number of digits. For example a 4 digit B field will occupy 2 bytes. But 2 bytes can accommodate values up to 32K - well beyond the 9,999 capacity of a 4 digit field. The conversion to packed ensures that only 4 digits are passed into the calculation and only four digits come out. When you use types I and U the compiler assumes you know what you are doing and don't need the safety blanket. For the same reasons you should always use I or U when an API specifies a field as binary otherwise there is the possibility you will incur truncation. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
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.