× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.




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;

What you're doing is very different from what Michael was doing. He was setting the name of a data structure (not an individual subfield) to *zeros.

When you reference a DS name, you're referencing a character field that's as large as the whole DS. In your example Qty(1), Qty(2), etc are numeric fields. But Year(1) and Year(2) are 16A character fields.

To make your example equivalent to what Michael was doing, you'd have to do this:

   Year(1) = *Zeros;

Note that if you do this, Year(1) which is a 16A field would be set to '0000000000000000' (or in hex x'f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0f0')

This means that Qty(1) which overlays the first 4 bytes of Year(1) would contain x'f0f0f0f0' instead of x'0000000f', which would be a decimal data error.

You're correct that setting Qty(1) directly would work just fine, because that's the actual packed field, not an alphanumeric field that overlays it.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

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.