I'm going to re-engineer our ACS routines. They are a mess. But I'm curious
about the "best" way. I've narrowed it down to two techniques. The simpliest,
to me, is to just use a series of IF statements where the THEN portion ends
with an EXIT to terminate the ACS routine. The more complicated, but perhaps
more efficient, way is to use nested SWITCH and IF statements. I like the
straight IF simply because I think it will be easier to understand. And I don't
mean nested IFs. I mean something like:
IF cond1 AND cond2 AND cond3 THEN DO
...
EXIT
END
IF cond1 AND cond2 THEN DO
...
EXIT
END
IF cond1 THEN DO
...
EXIT
END
instead of:
IF cond1 THEN DO
IF cond2 THEN DO
IF cond3 THEN DO
...
END
ELSE DO
...
END /* OF ELSE */
END /* OF IF cond2 */
ELSE DO /* OF IF cond1 */
...
END /* OF IF cond 1 */
Of course my "series of simple IFs" philosophy will result in more code being
written and executed. I just have a "gut feel" that it will be easier to
understand and maintain. I may relent a bit if I need to do a simple set of IFs
within a DO. Perhaps it would be "no nested DO groups". Eg:
IF cond1 AND cond2 THEN DO
...
IF cond3 THEN SET ..
IF cond4 THEN SET ...
IF cond5 THEN SET ...
IF cond6 THEN SET ...
EXIT
END
I really want it to be simple and easy to understand and maintain. Not like my
Perl and APL code! <grin>
John McKown
Systems Engineer IV
IT
Administrative Services Group
HealthMarkets(r)
9151 Boulevard 26 * N. Richland Hills * TX 76010
(817) 255-3225 phone *
[email protected] * www.HealthMarkets.com
Confidentiality Notice: This e-mail message may contain confidential or
proprietary information. If you are not the intended recipient, please contact
the sender by reply e-mail and destroy all copies of the original message.
HealthMarkets(r) is the brand name for products underwritten and issued by the
insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance
Company(r), Mid-West National Life Insurance Company of TennesseeSM and The
MEGA Life and Health Insurance Company.SM
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html