Re: Best (or any) practices to rewrite spaghetti

2011-02-03 Thread Tony Thigpen
Personally, I consider a 'branch to abnormal exit' much better than trying to unwind all the 'perform' levels, be it COBOL or Assembler. I have seen programs where they attempted to unwind everything during an error and ended up processing code unintentionally. Tony Thigpen -Original

Re: Best (or any) practices to rewrite spaghetti

2011-02-03 Thread John Ehrman
There's no reason your SP macro code can't include a jump to an error handler when an error occurs. Donald Knuth once wrote a scholarly article called Structured Programming with GOTO Statements where he showed that attempts to be purely structured were often more obscure than using a GOTO when

Re: ASSEMBLER-LIST Digest - 20 Jan 2011 to 21 Jan 2011 (#2011-11)

2011-02-03 Thread Roger Bolan
Another thing to check is the LOCK or UNLOCK status by issuing the PROFILE command with no parameters on the ISPF command line while in edit on one of the affected members: =PROF JCL (FIXED - 80)RECOVERY ONNUMBER OFF.. =PROF CAPS ONHEX OFFNULLS ON

Re: Best (or any) practices to rewrite spaghetti

2011-02-03 Thread Rob Scott
One of the ways I avoid too many nested IF statements is to use straddling DO/ENDDO around code that may require several let's get outta here now moments. For example : DO, Some code DOEXIT (TM,flag,bit,NO) ... Some more code DOEXIT

Re: Best (or any) practices to rewrite spaghetti

2011-02-03 Thread Edward Jaffe
On 2/3/2011 10:41 AM, Johanson, Adam wrote: Then, I told myself that the whole point of the exercise was to make the code more readable, so a branch to a return-to-caller label every now and then didn't really defeat the purpose and actually _did_ help things. IMHO, rather than seeing

Re: Best (or any) practices to rewrite spaghetti

2011-02-03 Thread Roger Bolan
I'm sure others will tell you about coding techniques and structured macros etc. My advice when improving old spaghetti assembler code is this: Make sure you have a regression test library ready to insure that the behavior of the new code matches the old code. Spaghetti code can hide a lot of

Re: Best (or any) practices to rewrite spaghetti

2011-02-03 Thread Rob van der Heij
On Thu, Feb 3, 2011 at 6:29 PM, Tony Thigpen t...@vse2pdf.com wrote: Personally, I consider a 'branch to abnormal exit' much better than trying to unwind all the 'perform' levels, be it COBOL or Assembler. I have seen programs where they attempted to unwind everything during an error and

Re: Best (or any) practices to rewrite spaghetti

2011-02-03 Thread Miklos Szigetvari
Hi Thank you very much for everybody. The answers has confirmed my view , to overuse a good technique can lead to obscure results. On 2/3/2011 9:15 PM, Roger Bolan wrote: I'm sure others will tell you about coding techniques and structured macros etc. My advice when improving old