On Thu, 10 May 2018 21:09:48 -0400, Hobart Spitz wrote:

>For those who may not be aware, SIGNAL is *not* a GOTO.
>
>I counted 18 SIGNALs, and only 1 CALL.  Many of the SIGNALs here seem to
>have been better done with DO...END.
>
>In the words of TRL, SIGNAL terminates "all active pending DO loops, DO
>groups, IF constructs, SELECT construct, and INTERPRET instructions" such
>that "they cannot be reactivated".
>
>With apologies to Eileen and/or the original coder:  Not being aware of
>that fact has apparently let the coder down into a "black hole".  I hope my
>post can encourage anyone who thinks this is the way to write REXX, to do
>better, and that anyone who copies sees this code not use it as an model
>for anything.
>
>This is not an issue of style, pedantics, or personal preference.  Using
>SIGNAL this way is even more of a barrier to maintainable, readable code
>than a GOTO.  For more information, see the appropriate resources.
> 
I saw that; I was appalled.  Also by the (lack of) indention.  There were a
few meager DO loops, mostly with a single line body.

Fear of indention is collateral damage of RECFM=FB,80.  When Rexx first came
to TSO it came with a GIM that recommended RECFM=VB,LRECL=generous.
IBM then ignored its own advice and made SYSPROC FB,80, dragging wiser
coders down with it.

"Black hole" is an apt metaphor.  It's hard to escape.  To convert SIGNA
loops to DO loops the programmer must eliminate any interior SIGNALs.

We had a VM sysprog who was SIGNAL-afficted.  Now retired, but his ugly
code remains.  In some fairnes, it was an interactive menu-driven system
and some menus had options to jump to other menus.  But I would have
used a SELECT within a main DO loop, even though that mostly emulates
GOTO.

-- gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to