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


  • Subject: Re: Program standards
  • From: Denis Robitaille <denisr@xxxxxxxxxx>
  • Date: Wed, 28 May 1997 16:25:27 -0700
  • Organization: Cascades Inc.

I have read with great interest the tread regarding DOW/DOU and named
indicator. Here is how we see it at my shop:

I use DOU if and only if i want to do at least 1 pass in the loop (1,n
relation). I use DOW otherwise (0,n relation). in the DOW loop, i use
the ITER with a READ before. This way, no change inside the loop can
cause trouble.

For the indicator thing. First, all are new development is done in ILE
RPG. To test the result of a read or a chain, we use an INFDS data
structure for each file, this way i have code like:
...
F FILE IC  E       K DISK    INFDS(i@FILE)
...
d @eof           c                   00011
d @NotFound      c                   00012
d @Found         c                   00000
...
d i@FILE    e ds       extname(geinfds) prefix(xxx_)
...
c     c@FILE     chain   FILE                 55
c                if      xxx_sts = @NotFound
....

Note: geinfds is an external DS that define the content of a data base
file infds.

      we use the prefix keyword to make sure that they are unique names
per file.

      we define constants for the differant possible outcome of a
read/chain operation.

we always use indicator 55 (for no particular reason).

this way, the code is indicator independant and, i think, clearer.

When we need other indicators (to controls subfile, display attribute
...) we use the technique that i first saw in NEWS/400 february 1997
page 65. In short, we overlay the array *IN with variables that have
more meaininful names. Ex: @sfldsp instead of *in42 to control the
sfldsp dds keyword. pc#fielda instead of *in29 to specify the position
cursor display attribute for the feild FIELDA.

With those 2 techniques, i can program indicatorless program without to
much fussing around.
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This is the Midrange System Mailing List!  To submit a new message,   *
* send your mail to "MIDRANGE-L@midrange.com".  To unsubscribe from     *
* this list send email to MAJORDOMO@midrange.com and specify            *
* 'unsubscribe MIDRANGE-L' in the body of your message.  Questions      *
* should be directed to the list owner / operator: david@midrange.com   *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *


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.