Software

GOBACK vs STOP RUN In Cobol: Difference and Comparison

A GOBACK statement never goes hand in hand with a declarative procedure specified. Stop run’s ideal use is for Main programs or Stand-alone programs, but it will be utilized in Subprograms further where it returns control to OS.

Go-backs are employed in both Main and subprograms. It works like a stop run in main modules and submodules; it gives control to main programs.

Key Takeaways

  1. GOBACK returns control to the calling program or operating system, terminating the current program.
  2. STOP RUN terminates the entire run unit, including all programs in the hierarchy.
  3. GOBACK is preferred in modular programming, while STOP RUN is used in standalone programs.

GOBACK vs STOP RUN In Cobol

GOBACK signals the end of the main processing routine of a COBOL program, returning program control to the system that initiated it. STOP RUN is a COBOL statement used to end a program and release resources held by the program. When executed, the program control returns to the system that initiated the program.

GOBACK vs STOP RUN In Cobol

Go back is a statement that refers to the logical end of a given program in COBOL.

While its usage can be regarded as confusing, it makes no distinction between an absolute termination and being discarded (elements are deleted).

In contrast with this type of definition, the second value declared has two parameters.

Stop Running: All the dynamically allocated programs are also deleted from the run unit. Because it gives the control back to the OS, it’s advised to use it only in the Main modules.

Also Read:  Domain Name vs Web Hosting: Difference and Comparison

Not recommended to use in Sub-programs because it gives control back to OS, where the sub-program is supposed to send control back to its main module.

Comparison Table

Parameters Of ComparisonGO BACK In CobolSTOP RUN In Cobol
Used forLogical endProgram termination
Control BackYesNo
ModulesManyMain
FunctionChanges status of the fileDeletes all the file
SubmodulesYesNo
Runtime environmentYesNo

What is Go Back In Cobol?

A GOBACK statement comes after imperative statements or usage of the only statement in an exceeding sentence because statements following the GOBACK statement don’t seem to be executed.

This allows for variable access control-based operations like CIL.

The parameters of an array are literal, and its result or output on success or failure (or both) while elements without such assignment remain unchanged. Go back statement.

The above code looks correct because there is no need for any special case declaration within each subroutine; this isn’t true in all cases.

In some programs where custom routines have been defined as such, or with variable name names not preceded by-, ‘you can skip over one rather than another pair and still get it executed correctly using automatic evaluation when evaluating functions declared inside a variable.

The GOBACK statement ends after an additional code than the equivalent exit program, as a result, stops the run statement.

A GOBACK statement must not be executed while executing a declarative procedure. Go-backs are employed in both Main and subprograms.

What is Stop Run In Cobol?

As the name implies, it stops the execution of the program and offers control back to the OS.

Also Read:  Google vs Microsoft: Difference and Comparison

With stop run, all the dynamically allocated programs are also deleted from the run unit.

Because it gives the control back to the OS, it’s advised to use it only in the Main modules.

Not recommended to use in Sub-programs because it gives control back to OS, whereas the sub-program is meant to send control back to its main module.

It also closes all the files related to the run unit. As the name implies, it stops the execution of the program and offers control back to the OS.

It also closes all the files related to the run unit.

This is not a decent practice as there have been many examples, like CVS versions that started using JAVA executable binaries with no problem on Ubuntu Server 14 by default, but why can’t they be developed so other users haven’t got this same problem too?

I believe, again, that one should ask them if their version has done better when running with Java Runtime Environment (JRE), which supports shared object file formats – like Microsoft Visual Studio or Google Code Compilation Tools.

Stop-run deletes the files and can’t be employed in most modules. It works in submodules.

Main Differences Between GOBACK and STOP RUN In Cobol

  1. Go back is used to show the logical end, but stop-run is used for program termination.
  2. Going back gives control back, but stopping running does not.
  3. Go back can be used in many modules, but stop run can be used only in the main module.
  4. Go back changes the status of the file in the run unit, but stop-run deletes the file in the run unit.
  5. Go back can be used in sub-modules, but stop run cannot be used in sub-modules.
  6. Go back is controlled by the runtime element, but stopping the run is not controlled by the runtime environment.
References
  1. https://ieeexplore.ieee.org/abstract/document/4812753/
  2. https://dl.acm.org/doi/pdf/10.1145/1010884.1010889
Also Read:  ExecuteQuery vs ExecuteUpdate: Difference and Comparison

Want to save this article for later? Click the heart in the bottom right corner to save to your own articles box!

17 Comments

  1. This article offers a comprehensive exploration of the GOBACK and STOP RUN statements in COBOL, providing a nuanced understanding of their functionalities in different program contexts. The explanatory details about the array parameters and variable access control-based operations are particularly enlightening.

    1. I found the analysis of the GOBACK statement’s parameters and their impact on program execution to be quite insightful. The article provides valuable clarity on the nuances of this statement’s usage with respect to array operations and subroutine execution.

    2. The delineation of the GOBACK statement’s termination procedure and its implications for program execution is highly informative. The article effectively highlights the significance of this statement in COBOL program flow control.

  2. The article delves into the intricacies of COBOL programming and provides a thorough analysis of the GOBACK statement’s functionality. The comparisons drawn between GOBACK and STOP RUN offer valuable insights into program control and file management within COBOL applications.

  3. The article provides an insightful comparison between GOBACK and STOP RUN in COBOL, elucidating the differences in program control and file management. The incorporation of references and a detailed comparison table further enhances the article’s informative value.

  4. The detailed comparison presented in this article serves as a comprehensive resource for anyone seeking to understand the differences between GOBACK and STOP RUN in COBOL. It covers various aspects such as control flow, file handling, and module-specific use, offering a well-rounded explanation of each statement’s functionality.

    1. I found the breakdown of the usage scenarios for GOBACK and STOP RUN to be particularly informative. The article effectively delineates the contexts in which each statement is best suited, enhancing the reader’s understanding of their practical applications.

    2. Agreed, the clarity of the comparison table and the description of the runtime environment control further solidify the article’s value in elucidating the nuances between GOBACK and STOP RUN.

  5. The comprehensive comparison of GOBACK and STOP RUN in COBOL presented in this article is highly informative. It elucidates the differences in their functionalities and usage scenarios, providing readers with a detailed understanding of their roles in program flow control and termination.

    1. The detailed explanation of the runtime environment control and the practical applications of GOBACK and STOP RUN is immensely valuable. It offers readers a clear insight into the nuanced differences between these statements.

    2. Agreed, the article effectively dissects both statements’ functionalities and explores their respective impacts on program execution and resource management. The delineation of the differences between GOBACK and STOP RUN is particularly enlightening.

  6. The comprehensive analysis of GOBACK and STOP RUN in COBOL in this article offers readers a valuable resource for understanding these statements’ implications for program execution and resource management. The detailed comparison table and elucidation of usage scenarios greatly enhance the article’s informative value.

  7. The detailed dissection of the GOBACK and STOP RUN statements in COBOL demonstrates the author’s expertise in the field. The article effectively captures the significance of these statements in program execution and delineates their respective roles in various program types and modules.

    1. Indeed, the exploration of the runtime environment control and the differences in file operations between GOBACK and STOP RUN is quite illuminating. It enriches the reader’s understanding of the distinct functionalities offered by each statement.

  8. This article provides a comprehensive and in-depth comparison of the GOBACK and STOP RUN statements in COBOL. Both functions are necessary for program flow control and the nuances between them are well-explained. I appreciated the emphasis on the use cases for each one, such as GOBACK being preferred in modular programming.

    1. I agree, and I found the accompanying references to be quite valuable. They provide additional context and background information to support the content of the article.

    2. Yes, the references are particularly helpful for those looking to delve deeper into the details of COBOL program structure and code execution. The comparison table also aids in quickly understanding the main differences between GOBACK and STOP RUN.

Leave a Reply

Your email address will not be published. Required fields are marked *

Chara Yadav

Chara Yadav holds MBA in Finance. Her goal is to simplify finance-related topics. She has worked in finance for about 25 years. She has held multiple finance and banking classes for business schools and communities. Read more at her bio page.