---
title: "COBOL: Static Vs Dynamic Call Which is Better"
description: "Static call is better than Dynamic call. I have shared top differences of these two calls."
url: https://srinimf.com/2015/01/25/cobol-static-call-and-dynamic-call/
date: 2015-01-25
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2015/01/pexels-photo-5368960.jpeg?fit=1880%2C1253&ssl=1
categories: ["COBOL"]
tags: ["COBOL Dynamic call", "COBOL Static call", "COBOL Tips and Tricks"]
type: post
lang: en
---

# COBOL: Static Vs Dynamic Call Which is Better

Static call Vs. Dynamic call, and which is better? The answer is it depends. Precisely, a Static call is faster and takes less CPU time since the load module sits with the main program’s load module.

Related[COBOL DB2 Program 10 Best Points You Need](https://srinimf.com/2015/07/30/mainframe-10-powerful-points-for-cobol-and-sql-programs/)

However, **the Dynamic call is slower and** takes more CPU time since the load module is separately stored and takes extra time to place with the main module.

## **1. The Static Vs. Dynamic call differences**

![Cobol Static and dynamic calls](https://i0.wp.com/srinimf.com/wp-content/uploads/2015/01/untitled3.png?resize=445%2C323&ssl=1)*Static vs Dynamic call differences*

## 2. **Example for static call**

```
PROCEDURE DIVISION.
CALL "SUBPROG" USING RECORD-1.
CALL "PAYMASTR" USING RECORD-1 RECORD-2.
STOP RUN.
```

---

Advertisements

## 3. **Example for dynamic call**

```
PROCEDURE DIVISION.
. . .
MOVE "SUBPROG" TO PGM-NAME.
CALL PGM-NAME USING RECORD-1.
CANCEL PGM-NAME.
MOVE "PAYMASTR" TO PGM-NAME.
CALL PGM-NAME USING RECORD-1 RECORD-2.
STOP RUN.
 Usage of Entry
PROCEDURE DIVISION USING PAYREC.
. . .
EXIT PROGRAM.
ENTRY "PAYMASTR" USING PAYREC PAY-CODE.  
<<<<<< This shows how one subprogram 
calls another program >>>>
    . . .
GOBACK.
```

## **2. Compiler options: DYNAM and NODYNAM**

**DYNAM**

Related[CICS sub program these are the ways to call](https://srinimf.com/2013/05/07/3-rules-calling-sub-programs-from-cics/)

The DYNAM option applies to dynamic calls and is not for static calls.

**NODYNAM**

The NODYNAM applies to both static and dynamic calls.

References

- [Static and Dynamic Calls](https://www.ibm.com/support/knowledgecenter/SS6SG3_4.2.0/com.ibm.entcobol.doc_4.2/PGandLR/tasks/tpsub04.htm)

Related Posts

- [COBOL DB2 Program 10 Best Points You Need](https://srinimf.com/2015/07/30/mainframe-10-powerful-points-for-cobol-and-sql-programs/)DateJuly 30, 2015
- [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
- [Logic to call COBOL program from stored Procedure](https://srinimf.com/2013/03/22/db2-calling-cobolcjava-programs-from-stored-proc/)DateMarch 22, 2013

### 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%2F01%2F25%2Fcobol-static-call-and-dynamic-call%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2015%2F01%2Fpexels-photo-5368960.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=COBOL%3A%20Static%20Vs%20Dynamic%20Call%20Which%20is%20Better)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2015/01/25/cobol-static-call-and-dynamic-call/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2015/01/25/cobol-static-call-and-dynamic-call/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2015/01/25/cobol-static-call-and-dynamic-call/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2015/01/25/cobol-static-call-and-dynamic-call/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20COBOL%3A%20Static%20Vs%20Dynamic%20Call%20Which%20is%20Better&body=https%3A%2F%2Fsrinimf.com%2F2015%2F01%2F25%2Fcobol-static-call-and-dynamic-call%2F&share=email)
-

### Like this:

Like Loading…
