---
title: "COBOL: Indexed By Vs Subscript key Differences"
description: "Index vs Subscript and the key differences in terms of COBOL"
url: https://srinimf.com/2015/07/21/5-key-differences-of-index-and-subscript-for-cobol-programmers/
date: 2015-07-21
modified: 2022-11-16
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2015/07/how-index-is-better-than-sbscript.jpg?fit=1200%2C700&ssl=1
categories: ["COBOL"]
tags: ["COBOL Indexed By vs Subscript"]
type: post
lang: en
---

# COBOL: Indexed By Vs Subscript key Differences

Here are the differences between **index and subscript in COBOL**. Click to read on [INDEXED BY](https://srinimf.com/2015/07/20/mainframe-cobol-occurs-indexed-byusage-is-index-1-of-2/) and [KEY IS ](https://srinimf.com/2015/03/24/cobol-use-of-key-phrase-in-occurs-clause/)of a Table.

## **Subscript in COBOL**

- Subscript should be an integer.
- It should have a working storage definition
- Subscript can be passed to a sub-program
- Subscript varies from 1 to size of OCCURS
- Subscript references a Table item

---

[COBOL Refresher](https://srinimf.com/2017/04/23/the-simplified-cobol-tutorial-to-refresh-quickly/refresh-cobol-quickly/)[Download](https://srinimf.com/wp-content/uploads/2017/04/refresh-cobol-quickly.doc)

---

## **Indexed By in COBOL**

1. An **INDEXED BY** XXXX phrase must be **defined** for an array/table
2. An index cannot be passed to a sub-program
3. It does not require working storage definition
4. The index varies from 0 to size of (OCCURS-1)
5. It references a Table item.
6. It is an internal representation
7. Performance-wise index is good compared to subscript

Related Posts

- [COBOL: How to Use INDEXED BY Clause](https://srinimf.com/2011/06/27/cobol-index-and-subscript/)DateJune 27, 2011
- [COBOL: SEARCH Vs PERFORM Which is Better](https://srinimf.com/2016/03/01/searching-cobol-table-with-search-and-without-serach/)DateMarch 1, 2016
- [COBOL: How to Use PERFORM Varying Correctly](https://srinimf.com/2015/07/24/mainframe-cobol-occurs-indexed-byusage-is-index-2-of-2/)DateJuly 24, 2015

### 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%2F07%2F21%2F5-key-differences-of-index-and-subscript-for-cobol-programmers%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2015%2F07%2Fhow-index-is-better-than-sbscript.jpg%3Ffit%3D1200%252C700%26ssl%3D1&description=COBOL%3A%20Indexed%20By%20Vs%20Subscript%20key%20Differences)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2015/07/21/5-key-differences-of-index-and-subscript-for-cobol-programmers/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2015/07/21/5-key-differences-of-index-and-subscript-for-cobol-programmers/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2015/07/21/5-key-differences-of-index-and-subscript-for-cobol-programmers/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2015/07/21/5-key-differences-of-index-and-subscript-for-cobol-programmers/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20COBOL%3A%20Indexed%20By%20Vs%20Subscript%20key%20Differences&body=https%3A%2F%2Fsrinimf.com%2F2015%2F07%2F21%2F5-key-differences-of-index-and-subscript-for-cobol-programmers%2F&share=email)
-

### Like this:

Like Loading…