---
title: "Cobol Tough Questions (1 of 3)"
description: "COBOL tough interview questions part 1 of 3"
url: https://srinimf.com/2012/01/01/cobol-tough-questions-1-of-3/
date: 2012-01-01
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2012/01/cobol-tough-questions-1-of-3.jpg?fit=1200%2C900&ssl=1
categories: ["COBOL"]
tags: ["COBOL Interview Questions", "COBOL Tips and Tricks"]
type: post
lang: en
---

# Cobol Tough Questions (1 of 3)

[Here is](https://srinimf.com/2016/02/01/how-to-give-vb-record-in-linkage-section/) [Cobol](http://astore.amazon.com/mainframesrin-20/detail/0471722618/175-8343130-5378911) [tough questions](https://srinimf.com/2012/02/28/cics-tough-questions-2of-3/):

Related[COBOL OCCURS Clause How to Code Correctly](https://srinimf.com/2015/12/26/3-ingenious-cobol-occurs-examples-that-you-never-miss/)

**1. What is the relation between INITIAL and BY CONTENT?**

When you choose to use the **initial **in the main program, which means whenever you invoke, its state comes to the **initial** – all the working storage values remain the same as before-and-after the call.

Related[COBOL: Indexed BY Vs USAGE Vs OCCURS](https://srinimf.com/2015/07/20/mainframe-cobol-occurs-indexed-byusage-is-index-1-of-2/)

When you pass values to the sub-Program, by calling it using  **BY CONTENT, **see the below example, those values remain the same – not initialized.

Related[COBOL: How to Initialize Pointer Variable an Example](https://srinimf.com/2015/09/07/cobol-usage-is-pointer-data-item/)

Call ‘sub’ using by content A1 ==> Main Progrm

Related[COBOL String modification idea using pointer statement](https://srinimf.com/2012/03/28/cobol-string-modification/)

Procedure division using A1 ==> [Sub program](https://srinimf.com/2016/04/06/cics-sample-program-for-xctl/)

**2. When STRING is a [pointer variable](https://srinimf.com/2015/12/31/how-to-pass-cobol-pointer-data-items-in-call-by-reference/), how many non-black characters the variable WC-count will have**?** **

```
Move 1 to WC-count
String first-name delimited by ' '
Into Name-out
With POINTER WC-count.
```

**3. The last statement in the [called program](https://srinimf.com/2017/03/02/cobol-call-by-reference-and-call-by-content/) is ‘EXIT PROGRAM’ or ‘GO BACK’?**

Here is my previous post on [Exit Program and Go BACK](https://srinimf.com/2015/10/04/cobol-subroutine-why-exit-program-is-mandatory/).

**4. Array within the array?**

```
01 Table occurs 10.
   03 field-1      pic xxx.
   03 sub1table    pic 9(5) occurs 5.
   03 field-2      pic 99.
It is then possible to refer to an entire record:
table (IDX)
or a field in it:
field-1 (IDX)
or a field in a sub-table:
sub-table (IDX1, IDX2).
```

**Related posts**

- [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
- [COBOL VB Files – Top Interview Questions](https://srinimf.com/2015/02/04/cobol-tough-interview-questions-on-vb-files/)DateFebruary 4, 2015
- [COBOL Tough Questions (2 of 3)](https://srinimf.com/2012/01/08/cobol-tough-questions-2-of-3/)DateJanuary 8, 2012

### 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%2F2012%2F01%2F01%2Fcobol-tough-questions-1-of-3%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2012%2F01%2Fcobol-tough-questions-1-of-3.jpg%3Ffit%3D1200%252C900%26ssl%3D1&description=Cobol%20Tough%20Questions%20%281%20of%203%29)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2012/01/01/cobol-tough-questions-1-of-3/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2012/01/01/cobol-tough-questions-1-of-3/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2012/01/01/cobol-tough-questions-1-of-3/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2012/01/01/cobol-tough-questions-1-of-3/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20Cobol%20Tough%20Questions%20%281%20of%203%29&body=https%3A%2F%2Fsrinimf.com%2F2012%2F01%2F01%2Fcobol-tough-questions-1-of-3%2F&share=email)
-

### Like this:

Like Loading…
