|
4-byte binary fields are a convention for identifying the "integer" data type. It is NOT referring to the old RPGIII Binary fields. And I don't buy the "4B" argument: 0085.00 D DS 0086.00 D MSGDLN 1 4B 0087.00 D MSGDLN2 5 8B 0 Once you get passed the first subfield, the 4B identity is gone. The RPG binary fields ("B" data types) are 100 to 1000 times slower than the I (integer) data types. This gives me reason enough to avoid them. In addition the overhead that causes this slowness is due to the system converting the binary data into packed decimal (under the covers) and then back again. A poor design decision on IBM's part was in requiring the Integer data type to be coded as 3I, 5I, 10I or 20I is the root of the problem. It should have been 1I, 2I, 4I, and 8I. IBM could add this capability without impacting existing code--and it would make things much easier to comprehend by those still using the "B" data type. Using a "B" data type today when calling an API is exactly the same kind of code as this: C 25 DO 6 C Add 1 Counter C Enddo In other words, it is on par with conditioning indicators used with structured operation codes. -Bob Cozzi -----Original Message----- From: rpg400-l-bounces+cozzi=rpgiv.com@xxxxxxxxxxxx [mailto:rpg400-l-bounces+cozzi=rpgiv.com@xxxxxxxxxxxx] On Behalf Of MWaite@xxxxxxxxxxxx Sent: Wednesday, March 09, 2005 10:42 AM To: rpg400-l@xxxxxxxxxxxx Subject: Making sense of 4-byte binary fields I may be going against the grain here, but if the documentation says 4-byte binary I just specify 4-byte binary in my code, as shown below, which works just fine, and the way we always used to define binary fields prior to RPGIV. 0085.00 D DS 0086.00 D MSGDLN 1 4B 0 The problem lies if you code the field using the new sexy type 'S' for a standalone field, when you only get the opportunity to specify the number of DIGITS, rather than bytes. So, keep your 4Bs, but remember to code the field as part of a data structure, not a standlone field. This way, the numbers do appear to make sense!(And we don't need to know that the machine can get 10 digits in 4 bytes!) Hope this provides some illumination... -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
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.