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



Hi Joe -

On Wed, 7 Nov 2007 23:05:39 -0600, "Joe Pluta"
<joepluta@xxxxxxxxxxxxxxxxx> wrote:

From: Ken Sims

select
when *in01 and (not *inmr)
write a delete record to the interface file
when *in02 and (not *inmr)
write an add record to the interface file
when *in02 and (oldds <> newds)
write a change record to the interface file
endsl

The third select doesn't need "and *inmr" because if the program
executes that when and *in02 is on, *inmr must of necessity be on.
Otherwise the second when would have been true and the third when
won't be checked.

Teeny quibble... on the second case, you don't need to check *IN02. If
*INMR is off, then either *IN01 is on or *IN02 is on. If *INMR is off and
you've gotten to the second case, you know that *IN01 is off, so *IN02 must
be on.

(I still consider Boolean logic to be the coolest thing I ever learned.
Maybe that's why I am such a computer geek.)

You're right, the *IN02 is not needed on the second WHEN.

It's probably carryover from my S/32, S/34, and S/36 days when coding
programs with multiple record formats in one file. Since there might
be a catchall record format in the I-specs (for any record formats
that the program didn't use or anything bogus in the file), I always
used the record-identifying indicator.

Also, it serves as somewhat useful auto-documentation so that it's
clear which file is being processed since cycle-driven programs are
rare in our shop. For that reason I'm going to leave it in place even
though I normally take advantage of "short-circuiting" in condition
checking (as I did with the omission of *INMR on the third WHEN).

Ken
Opinions expressed are my own and do not necessarily represent the views
of my employer or anyone in their right mind.

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.