× 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.



> Perhaps the more enlightened will chime in
> to explain why an error does not result in
> every data structure.

I am still seeking Nirvana but I'll chip in an answer hoping to get a bit
closer...

In general, INZ on a data structure 'works' to prevent decimal data errors
because the underlying code which references that DS uses it before it gets
populated.  An example is when you have something like this:

d                 ds
d phone                         10s 0
d  npa                    1      3s 0
d  nnx                    4      6s 0
d  line                   7     10s 0

If 'phone' is a field in your database and you do:

c     ws_phone      chain     master
c                   if        npa = default_npa

you will get a decimal data error because 'phone' has not been populated by
the CHAIN, nor was it initialised in the DS.  Conditioning the 'if' on
'%found' would avoid the error, as would doing a CLEAR or RESET if 'not
%found'.  However, if the very first CHAIN was successful, 'phone' got a
real value and you will never see a decimal data error.  That may be why it
seems like some DS' need INZ and some do not.  I would guess that this
(calculation reference prior to loading) is the most common situation, but
you can also get it if there are no records in your database file:

fmaster    ipe  e             disk

oqsysprt   t    L1
o                                            5 'Total'
o                       npa                  9

The central idea is that if there is a numeric variable in a data structure,
you MUST initialise it prior to first use.  You can tell the compiler to do
it with INZ or you can write your code in such a way that you do it
yourself, or avoid all references to the un-initialised variable.

I hope this helps.
  --buck




As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.