Stop Run vs GoBack
- From: "William M. Klein" <wmklein@xxxxxxxxxxxxxxxxx>
- Date: Sun, 24 Jun 2007 18:35:20 GMT
(new thread, "old" topic)
Facts and Options inter-mixed:
1) GoBack is in the '02 Standard (but not any earlier ones).
2) In previous (pre-02) Standards, it was "non-conforming" (but often accepted
as an extension) to code an EXIT Program immediately followed by a Stop Run.
3) COBOL (unlike many - possibly MOST - other languages) does NOT require you to
"declare" a program as either a "MAIN" or "SUB" at compile time. (Having a
LINKAGE section *implies* that you are a subprogram, but that is neither
required nor universally even true if you access the fields in it).
4) For as long as I have been involved in IBM mainframe (mostly MVS)
programming, the use of GOBACK "universally" instead of Stop Run and Exit
Program has been recommended by most shops (and classes). (As mentioned
elsewhere - at one time it was REQUIRED for CICS and some IMS programming).
5) Use of STOP RUN in a DECLARATIVE (or ABEND routine) is medium common. This
means that when the situation occurs, one wants the application to STOP - no
matter whether it is "sub" or "main".
6) The "biggest" issue with GoBack (IMHO) has to do with "multi-language"
applications. It is a little unclear where a GoBack takes you - to the CALLing
non-COBOL system or to the operating system. IBM even changed this (at one
stage) with VS COBOL II - although it is now back to the "traditional" return to
the CALLing program (or CLASS/Method - in the case of OO).
***
Personally, I can't see any reason NOT to "universally" use GOBACK - (except to
require immediate application termination). However, if you want "portable"
code to non-IBM compatible (and pre '02 Standard) applications, you might want
to think twice about it.
--
Bill Klein
wmklein <at> ix.netcom.com
.
- Follow-Ups:
- Re: Stop Run vs GoBack
- From: Howard Brazee
- Re: Stop Run vs GoBack
- From: Pete Dashwood
- Re: Stop Run vs GoBack
- Prev by Date: Re: Web Services (Retouch)
- Next by Date: Re: (OT) Canada vs New Zealand
- Previous by thread: COBOL, Java and.or C++
- Next by thread: Re: Stop Run vs GoBack
- Index(es):
Relevant Pages
|
|