Cobol Interview Preparation Guide
Download PDF

Cobol Interview Questions and Answers will guide us now that COBOL is one of the oldest programming languages in computer history. COBOL name is an acronym for COmmon Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments. Learn COBOL programming basic and advance concepts or get preparation of COBOL based jobs interview by our this Cobol Interview Questions and Answers Guide.

110 Cobol Questions and Answers:

Table of Contents

Cobol Interview Questions and Answers
Cobol Interview Questions and Answers

1 :: How many sections are there in data division?

SIX SECTIONS

1. FILE SECTION
2. WORKING-STORAGE SECTION
3. LOCAL-STORAGE SECTION
4. SCREEN SECTION
5. REPORT SECTION
6. LINKAGE SECTION

2 :: What is Redefines clause?

Redefines clause is used to allow the same storage allocation to be referenced by different data names.

3 :: What is the different between index and subscript?

Subscript refers to the array of occurrence, where as Index represents an occurrence of a table element. An index can only modified using perform, search & set. Need to have an index for a table in order to use SEARCH and SEARCH All.

4 :: What is the difference between Structured COBOL Programming and Object Alternativelyiented COBOL programming?

Structured programming is a Logical way of programming, you divide the functionalities into modules and code logically. OOP is a Natural way of programming; you identify the objects first, and then write functions, procedures around the objects. Sorry, this may not be an adequate answer, but they are two different programming paradigms, which is difficult to put in a sentence or two.

5 :: What divisions, sections and paragraphs are mandatory for a COBOL program?

IDENTIFICATION DIVISION and PROGRAM-ID paragraph are mandatory for a compilation error free COBOL program.

6 :: What happens when we move a comp-3 field to an edited (say z (9). ZZ-)?

The editing characters r to be used with data items with usage clause as display which is the default. When u tries displaying a data item with usage as computational it does not give the desired display format because the data item is stored as packed decimal. So if u want this particular data item to be edited u have to move it into a data item whose usage is display and then have that particular data item edited in the format desired.

7 :: What is the difference between external and global variables?

Global variables are accessible only to the batch program whereas external variables can be referenced from any batch program residing in the same system library.

8 :: What is difference between COBOL and VS COBOL II?

In using COBOL on PC we have only flat files and the programs can access only limited storage, whereas in VS COBOL II on M/F the programs can access up to 16MB or 2GB depending on the addressing and can use VSAM files to make I/O operations faster.

9 :: Difference between next and continue clause?

The difference between the next and continue verb is that in the continue verb it is used for a situation where there in no EOF condition that is the records are to be accessed again and again in an file, whereas in the next verb the indexed file is accessed sequentially, read next record command is used.

10 :: What is the Importance of GLOBAL clause According to new standards of COBOL?

When any data name, file-name, Record-name, condition name or Index defined in an Including Program can be referenced by a directly or indirectly in an included program, Provided the said name has been declared to be a global name by GLOBAL Format of Global Clause is01 data-1 pic 9(5) IS GLOBAL.

11 :: What is the Purpose of POINTER Phrase in STRING command?

The Purpose of POINTER phrase is to specify the leftmost position within receiving field where the first transferred character will be stored

12 :: What is the LINKAGE SECTION used for?

The linkage section is used to pass data from one program to another program or to pass data from a PROC to a program.

13 :: Describe the difference between subscripting and indexing?

Indexing uses binary displacement. Subscripts use the value of the occurrence.

14 :: Differentiate COBOL and COBOL-II. (Most of our programs are written in COBOLII, so, it is good to know, how, this is different from COBOL)?

The following features are available with VS COBOL II: 1. MVS/XA and MVS/ESA support. The compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. 2. VM/XA and VM/ESA support the compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode. 3. VSE/ESA supports the compiler and the object programs it produces can be run under VSE/ESA.

15 :: Why do we code S9 (4) comp. Inspite of knowing comp-3 will occupy less space ?

Here s9(4)comp is small integer ,so two words equal to 1 byte so totally it will occupy 2 bytes(4 words).here in s9(4) comp-3 as one word is equal to 1/2 byte.4 words equal to 2 bytes and sign will occupy 1/2 byte so totally it will occupy 3 bytes.

16 :: How do you code COBOL to access a parameter that has been defined in JCL? And do you code the PARM parameter on the EXEC line in JCL?

Using JCL with sysin. //sysin dd *here u code the parameters (value) to pass in to Cobol program /* and in program you use accept variable name (one accept will read one row)/.another way. 2) in jcl using parm statement ex: in exec statement parm=’john’,'david’ in Cobol pgm u have to code linkage section in that for first value you code length variable and variable name say, abc pic x(4).it will take john inside to read next value u have to code another variable in the same way above mentioned.

17 :: What do you feel makes a good program?

A program that follows a top down approach. It is also one that other programmers or users can follow logically and is easy to read and understand.

18 :: What is the difference between static call and Dynamic call?

In the case of Static call, the called program is a stand-alone program, it is an executable program. During run time we can call it in our called program. As about Dynamic call, the called program is not an executable program it can executed through the called program

19 :: Give some advantages of REDEFINES clause?

1. You can REDEFINE a Variable from one PICTURE class to another PICTURE class by using the same memory location.
2. By REDEFINES we can INITIALISE the variable in WORKING-STORAGE Section itself.
3. We can REDEFINE a Single Variable into so many sub variables. (This facility is very useful in solving Y2000 Problem.)

20 :: How to execute a set of JCL statements from a COBOL program?

Using EXEC CICS SPOOL WRITE (var-name) END-EXEC command. Var-name is a COBOL host structure containing JCL statements.

21 :: How do you submit JCL via a COBOL program?

Use a file //dd1 DD sysout=(*, intrdr)write your JCL to this file. Pl some on try this out.

22 :: What care has to be taken to force program to execute above 16 Meg line?

Make sure that link option is AMODE=31 and RMODE=ANY. Compile option should never have SIZE (MAX). BUFSIZE can be 2K, efficient enough.

23 :: What is the difference between SEARCH and SEARCH ALL? What is more efficient?

SEARCH is a sequential search from the beginning of the table. SEARCH ALL is a binary search, continually dividing the table in two halves until a match is found. SEARCH ALL is more efficient for tables larger than 70 items.

24 :: What guidelines should be followed to write a structured COBOL prgm?

1) Use ‘evaluate’ stmt for constructing cases.
2) Use scope terminators for nesting.
3) Use in line performs stmt for writing ‘do ‘constructions.
4) Use test before and test after in the perform stmt for writing do-while constructions.

25 :: What is Pic 9v99 Indicates?

PICTURE 9v99 is a three position Numeric field with an implied or assumed decimal point after the first position; the v means an implied decimal point.