---
title: "COBOL Ideas What Happens When You Give Stop RUN in Submodule"
description: "The simple and effective answer for STOP RUN and how it works in various scenarios"
url: https://srinimf.com/2017/04/09/what-happens-when-stop-run-given-in-subprogram/
date: 2017-04-09
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2017/04/cobol-stop-run.jpg?fit=1200%2C700&ssl=1
categories: ["COBOL"]
tags: ["COBOL Tips and Tricks", "STOP RUN in COBOL"]
type: post
lang: en
---

# COBOL Ideas What Happens When You Give Stop RUN in Submodule

There is a discussion in many forums that if we give ‘STOP RUN’ in the COBOL sub-module what will happen.

Related[COBOL: ADD or Subtract Sample Logic](https://srinimf.com/2017/09/27/cobol-arithmetic-the-best-format-why-you-need/)

---

*The [definition from IBM](https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_72/rzase/filstat.htm) – A STOP RUN statement returns control to the caller of the program at the nearest control boundary. If this is a hard control boundary, the activation group (run unit) will end, and all files scoped to the activation group will be closed.*

Related[CICS Commands: Return, GoBack, Stop Run, Exit Program](https://srinimf.com/2012/03/22/cics-return-goback-stop-run-exit-program/)

*The answer to this question is as follows.*

This is a Tricky question for COBOL developers. The right answer is it will stop executing the program.

> Sub-program cannot send control back to the main module. So your execution will be stopped when you give STOP RUN.

Whereas the [GOBACK and EXIT-PROGRAM](https://srinimf.com/2010/08/28/cobol-goback-and-stoprun/) are only passed control back to the calling program.

GOBACK has dual capability it can be given in both main and sub modules.

**Related Posts**

- [25 Top COBOL Recently asked Interview Questions](https://srinimf.com/2015/11/23/25-awesome-things-you-can-learn-from-these-cobol-interview-questions/)DateNovember 23, 2015
- [Why ‘PIC’ Clause Not Required for COBOL Comp, Comp-1, Comp-2](https://srinimf.com/2012/04/15/cobol-pic-clause-not-needed-for-comp-1-and-comp-2/)DateApril 15, 2012
- [CONTINUE vs SECTION in COBOL not the same why](https://srinimf.com/2017/07/24/the-clear-idea-on-continue-and-section-in-cobol/)DateJuly 24, 2017

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2017%2F04%2F09%2Fwhat-happens-when-stop-run-given-in-subprogram%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2017%2F04%2Fcobol-stop-run.jpg%3Ffit%3D1200%252C700%26ssl%3D1&description=COBOL%20Ideas%20What%20Happens%20When%20You%20Give%20Stop%20RUN%20in%20Submodule)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2017/04/09/what-happens-when-stop-run-given-in-subprogram/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2017/04/09/what-happens-when-stop-run-given-in-subprogram/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2017/04/09/what-happens-when-stop-run-given-in-subprogram/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2017/04/09/what-happens-when-stop-run-given-in-subprogram/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20COBOL%20Ideas%20What%20Happens%20When%20You%20Give%20Stop%20RUN%20in%20Submodule&body=https%3A%2F%2Fsrinimf.com%2F2017%2F04%2F09%2Fwhat-happens-when-stop-run-given-in-subprogram%2F&share=email)
-

### Like this:

Like Loading…
