View previous topic :: View next topic
|
Author |
Message |
jasorn Warnings : 1 Active User
Joined: 12 Jul 2006 Posts: 191 Location: USA
|
|
|
|
I've had very little exposure to CICS in my career but one thing I've noticed is that some shops I've worked in shunned gotos except in CICS applications.
Before I go on, I don't want to rehash the goto debate here.
I'm just curious if gotos have a benefit in CICS which helps override the goto hater's fears. And if someone could point me to something on the matter of gotos as they relate to best practice in CICS applications. I know google is my friend but he's not cooperating with me on this one.
The only real discussion I've found on the matter is a small blurb in two books I have. The problem is the newer of those books is 18 years old and in my quick browsing I found some recommendations in them which google tells me are old techniques and not recommended any more. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
I don't think there's a whole lot of benefit -- the few CICS programs I've written in the last years have had no GOTO statements at all. There used to be something of a push to use GOTO over PERFORM due to the overhead of the PERFORM statement, but as machines have gotten faster that push has pretty much died out. |
|
Back to top |
|
|
jasorn Warnings : 1 Active User
Joined: 12 Jul 2006 Posts: 191 Location: USA
|
|
|
|
So a high performance application with sub second SLA's might still get a benefit from the GOTO over perform? So far this is the only reason anyone has offered to me outside the traditional arguments around GOTO EXIT for and against.
Robert Sample wrote: |
There used to be something of a push to use GOTO over PERFORM due to the overhead of the PERFORM statement, but as machines have gotten faster that push has pretty much died out. |
|
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
It might but considering z10 cycle times, I think the application would have to be pretty unusual to require GOTO over PERFORM. The main determinant of response times is going to be I/O -- which is still milliseconds versus nanoseconds for code execution. |
|
Back to top |
|
|
jasorn Warnings : 1 Active User
Joined: 12 Jul 2006 Posts: 191 Location: USA
|
|
|
|
Thanks, Robert. That's enough for me. I'll go without them and see how it goes. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
FWIW, HANDLE CONDITIONS, catering to multiple errors, expand into a GO TO DEPENDING ON statement. However, since the inception of the RESP keyword (or NOHANDLE), introduced with CICS/MVS 1.7, many applications have had the HANDLE CONDITION API's removed in favor of RESP/NOHANDLE. Also, HANDLE CONDITION API's generate an internal CICS GETMAIN.
Bill |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Bill O'Boyle wrote: |
However, since the inception of the RESP keyword (or NOHANDLE), introduced with CICS/MVS 1.7, many applications have had the HANDLE CONDITION API's removed in favor of RESP/NOHANDLE. |
Error handling became much better when the RESP keyword was added, but my only complaint is that I wish they had included a four byte field with the CICS abend code that would have been generated so I could issue the correct abcode if really needed...... |
|
Back to top |
|
|
|