|
Scott Klement wrote:
Year(TY).Location(Unit) = *Zeros; Year(LY).Location(Unit) = *Zeros;That's nice -- and it'll work, provided everything in the DS is a zoned decimal field. But if you have any packed fields (for example, those that you're using external definitions on might be packed) then you'll have a mess because packed values can't have x'F0F0F0F0' in them.
Scott,I'm more than a little confused; perhaps I've misread or misinterpreted the note above. I use code like the example above all of the time to initialize packed fields to zeros, especially when creating new records. I've never gotten a decimal data error when doing that. I thought that, perhaps, data structure fields were (for some reason that eluded me) were different. So I ran a (admittedly very simple) test:
D Year DS Qualified dim(2) D Qty 7P 2 dim(4) inz(123)/FREE Year(1).Qty(2) = *Zeros; No DDE and debug showed that all elements were initialized to "123" and that, after the eval, the referenced element was zero.
What is it that I am missing here? Thanks. * Jerry C. Adams *IBM System i Programmer/Analyst B&W Wholesale Distributors, Inc.* * voice 615.995.7024 fax 615.995.1201 email jerry@xxxxxxxxxxxxxxx <mailto:jerry@xxxxxxxxxxxxxxx>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.