I did not realize that. (See, I've never used it.) The documentation (I am looking at the Cowlishaw book as I write this, not the IBM manuals) is less than clear on that important point. "All active pending DO loops, ... are terminated (i.e., they cannot be reactivated)" on a quick read would to me to imply the opposite.
I guess you could use SIGNAL as a DO exit only if you intended to terminate the program, not to recover and go on. Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Paul Gilmartin Sent: Sunday, January 14, 2018 4:31 PM To: [email protected] Subject: Re: curious: Popularity & use of C on z/OS. On Sun, 14 Jan 2018 16:07:24 -0800, Charles Mills wrote: >What's the problem with SIGNAL? > >(I've written a lot of Rexx, but never used SIGNAL labelname, only >SIGNAL ON ... . I drank the Structured Programming Kool-Aid in the >seventies.) > SIGNAL obliterates the active block structure of the current procedure but doesn't exit any procedure. A naive colleague once used SIGNAL labelname intending to exit a called procedure and return to a label before the main loop on an exceptional condition. Worked fine on test data. In production, it failed as soon as a large enough data set caused enough SIGNALs to overflow the call/return stack on the next iteration. Not easy to fix. Do not branch around the LM; FREEMAIN! I wish that ITERATE controlvariable and LEAVE controlvariable were enhanced to operate on any controlled DO with controlvariable in scope (EXPOSEd) even if the DO were in an enclosing procedure, and exit cleanly any intervening procedures -- a 1970's-structured longjump. ITERATE mainloop would have nicely solved my colleague's problem. -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
