Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Differences Between GOBACK and STOP RUN
All righty... there's been a bit of back-and-forth on this, seasoned with
heaping helpings of 'I recall (x)' and 'it seems to me that (y)'... so
when in doubt, turn to The Manual.

I mentioned that my work and training were in IBM mainframe environments
so I dug around a bit; the first one I've come across is rather recent,
Document Number SC26-9046-00 (COBOL for OS/390 & VM).  Copyright dates on
this are 1991 and 1998 so - in COBOL terms - it is a mere toddler... but
one needs to begin someplace.

According to
<http://publibz.boulder.ibm.com/cgi-.../>
80112234143>

--begin quoted text:

The GOBACK statement functions like the EXIT PROGRAM statement when it is
coded as part of a called program (or the EXIT METHOD statement when it is
coded as part of an invoked method) and like the STOP RUN statement when
coded in a main program.

[snip]

If control reaches a GOBACK statement while a CALL statement is active,
control returns to the point in the calling program immediately following
the CALL statement, as in the EXIT PROGRAM statement.

--end quoted text

There is, at the bottom of the page, a table which shows the actions taken
for the GOBACK:

Main Program: Return to calling program. (Can be the system and thus
causes the application to end.)

Subprogram: Return to calling program.

Next... according to the Index
<http://publibz.boulder.ibm.com/cgi-... />
0112234143>
both STOP and STOP RUN are detailed on the same page,
<http://publibz.boulder.ibm.com/cgi-...112234143&CASE=>.

--begin quoted text:

The STOP RUN statement closes all files defined in any of the programs
comprising the run unit.

--end quoted text

... and in the table at the bottom of the page, similar to that of the
GOBACK cited above, it states that the actions of STOP RUN are:

--begin quoted text

Main Program: Return to calling program.* (May be the system and cause the
application to end.)

Subprogram: Return directly to the program that called the main program.*
(May be the system and cause the application to end.)

--end quoted text

It seems that what I was taught - GOBACK always does the same thing while
STOP RUN can have unintended consequences, especially for a Main program
that has become a subroutine - is reflected in this; it would be
interesting to see what data others with manuals more hoary than this
one might be able to report.

DD


Report this thread to moderator Post Follow-up to this message
Old Post

06-24-07 02:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:11 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.