|
Dan wrote: > > I am currently exasperated trying to key the database INFDS. The data > management guide is calling for a binary data type with a length of 4, > which I've defined in DDS as '4B 0', but this defines a 2-byte field. > Should binary fields with length = 4 be defined as '10B 0'? > Should binary fields with length = 2 be defined as ' 5B 0'? > The data management guide is giving the length in bytes, while DDS is giving the length in digits. For 2-byte binary, use 4B 0. For 4-byte binary, use 9B 0. It's better to define those fields in RPG as integer, not binary, so in RPG, 10i 0 would be best. You can't code 10i in DDS, but you can code EXTBININT(*YES) in your RPG H spec to cause all external binary fields to be treated as integers in RPG. Unless you have dependencies in your code where you need external binary fields to be treated as decimal fields (converted to/from packed whenever they're used), it's a good thing to code EXTBININT(*YES) anyway. The reason it's better is that 9B can't hold all the values that the 4-byte binary fields in the feedback areas can hold, so occasionally you'll have problems with truncation or overflow.
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.