---
title: "EXIT PROGRAM – Real Reason to Code in Cobol Subroutine"
description: "In COBOL program there are three key phrases. Those are STOP RUN, GOBACK and EXIT PROGRAM. The phrase EXIT PROGRAM can use in subroutine. https://srinimf.com/2019/01/20/3-go-to-statements-to-avoid-in-..."
url: https://srinimf.com/2015/10/04/cobol-subroutine-why-exit-program-is-mandatory/
date: 2015-10-04
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2015/10/pexels-photo-6312362.jpeg?fit=1880%2C1253&ssl=1
categories: ["COBOL"]
tags: ["EXIT PROGRAM", "GOBACK"]
type: post
lang: en
---

# EXIT PROGRAM – Real Reason to Code in Cobol Subroutine

In COBOL program there are three key phrases. Those are STOP RUN, GOBACK and EXIT PROGRAM. The phrase EXIT PROGRAM can use in subroutine.

Related[COBOL: 3 Alternatives Where You Can Avoid GO TO Statements](https://srinimf.com/2019/01/20/3-go-to-statements-to-avoid-in-cobol/)

## 1. What happens if it has given

This statement “EXIT PROGRAM” gives control back to calling module. So, calling module continue processing still STOP RUN or GOBACK.

## 2. What happens if it has not given

If EXIT PROGRAM not be given, the calling module does not get control back. So, an unpredictable abend/exception occurs in calling module.

Related[COBOL: 3 Simple Tips to Know Module is Subroutine](https://srinimf.com/2015/10/05/how-to-identify-a-given-module-is-subroutine-in-cobol-programming/)

This is an interview question often asked in COBOL interviews.

Related Posts

- [COBOL: 3 Simple Tips to Know Module is Subroutine](https://srinimf.com/2015/10/05/how-to-identify-a-given-module-is-subroutine-in-cobol-programming/)DateOctober 5, 2015
- [Can “STOP RUN” be Given in COBOL Subroutines](https://srinimf.com/2015/10/04/can-stop-run-be-given-in-cobol-subroutines/)DateOctober 4, 2015
- [COBOL Ideas What Happens When You Give Stop RUN in Submodule](https://srinimf.com/2017/04/09/what-happens-when-stop-run-given-in-subprogram/)DateApril 9, 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%2F2015%2F10%2F04%2Fcobol-subroutine-why-exit-program-is-mandatory%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2015%2F10%2Fpexels-photo-6312362.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=EXIT%20PROGRAM%20-%20Real%20Reason%20to%20Code%20in%20Cobol%20Subroutine)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2015/10/04/cobol-subroutine-why-exit-program-is-mandatory/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2015/10/04/cobol-subroutine-why-exit-program-is-mandatory/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2015/10/04/cobol-subroutine-why-exit-program-is-mandatory/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2015/10/04/cobol-subroutine-why-exit-program-is-mandatory/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20EXIT%20PROGRAM%20-%20Real%20Reason%20to%20Code%20in%20Cobol%20Subroutine&body=https%3A%2F%2Fsrinimf.com%2F2015%2F10%2F04%2Fcobol-subroutine-why-exit-program-is-mandatory%2F&share=email)
-

### Like this:

Like Loading…
