×
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.
On 3/8/2016 11:16 AM, Vernon Hamberg wrote:
You pays your money - you takes your choice!
I prefer priming a DOW loop with a READ of whatever sort - I don't
really like doing a LEAVE in the middle for EOF condition - seems too
much like a GOTO abuse.
Repeating much of what John said, the use of ITER is specifically meant
to say we're jumping to the top of the loop. The reason I do it is so
that I can have multiple conditions that might cause a skip without
having to have increasing levels of indentation. My personal pet-peeve
is having more than a few levels of indentation. A simple example (I
don't know if the leading spaces will come through, but if not, just
pretend):
DCL-PROC
DOW not %eof detail-file
READ foreign-file 1
IF Condition 1
READ foreign-file 2
IF Condition 2
Perform computation
If Condition 3
In a medium-complex business case with a handful of external files and a
couple of conditions you can quickly get to five or more levels of
indentation. Depending on how you indent, it's a lot of real estate,
and to me it's just tough to follow. Using a read at the top of the
loop, I can always ITER on each condition to skip the record. I don't
have to have a whole bunch of nested IFs. As always, your mileage may vary.
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.