COBOL interview question set 1/COBOL Interview Questions and Answers for Freshers & Experienced

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.

Posted Date:- 2021-09-02 22:44:23

What Are The Steps You Go Through While Creating A Cobol Program Executable?

DB2 pre-compiler (if embedded SQL is used), CICS translator (if CICS program), Cobol compiler, Link editor. If DB2 program, create plan by binding the DBRMs.

Posted Date:- 2021-09-02 22:43:39

How Do You Set A Return Code To The Jcl From A Cobol Program?

Move a value to RETURN-CODE register. RETURN-CODE should not be declared in your program.

Posted Date:- 2021-09-02 22:42:25

What Is File Status 39 ?

Mismatch in LRECL or BLOCKSIZE or RECFM between your COBOL pgm & the JCL (or the dataset label). You will get file status 39 on an OPEN.

Posted Date:- 2021-09-02 22:41:32

In The Jcl, How Do You Define The Files Referred To In A Subroutine ?

Supply the DD cards just as you would for files referred to in the main program.

Posted Date:- 2021-09-02 22:40:45

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.

Posted Date:- 2021-09-02 22:39:55

What Is Comp Sync?

Causes the item to be aligned on natural boundaries. Can be SYNCHRONIZED LEFT or RIGHT.
For binary data items, the address resolution is faster if they are located at word boundaries in the memory. For example, on main frame the memory word size is 4 bytes. This means that each word will start from an address divisible by 4. If my first variable is x(3) and next one is s9(4) comp, then if you do not specify the SYNC clause, S9(4) COMP will start from byte 3 ( assuming that it starts from 0 ). If you specify SYNC, then the binary data item will start from address 4. You might see some wastage of memory, but the access to this computational field is faster.

Posted Date:- 2021-09-02 22:38:49

10) What is length is Cobol?

It is a special register that has the length of an elementary item or a group.

Posted Date:- 2021-09-02 22:38:15

What is the difference between the NEXT SENTENCE and CONTINUE in COBOL programing language?

In COBOL language, NEXT STATEMENT is used to give control to the next verb following the next period. Next Sentence is the collection of sentences that always ends with (.) so the control passes over to the next verb following the next period. When the NEXT SENTENCE is coded, 1 will not be added to input count.
CONTINUE statement is used to give control to the next verb after the explicit scope terminator. When CONTINUE is coded, +1 will be added to input count.

Posted Date:- 2021-09-02 22:37:06

For what 66 and 88 level used in Cobol?

In Cobol Level 66 is used for RENAMES clause and Level 88 is used for condition names.

Posted Date:- 2021-09-02 22:35:47

My Program Has An Array Defined To Have 10 Items. Due To A Bug, I Find That Even If The Program Access The 11th Item In This Array, The Program Does Not Abend. What Is Wrong With It?

Must use compiler option SSRANGE if you want array bounds checking. Default is NOSSRANGE. If no options provided then it will abend with SOC4 -An Invalid address referenced due to subscript/index error.

Posted Date:- 2021-09-02 22:35:08

What are an SSRANGE and NOSSRANGE?

These are options for a compiler to find the subscript out of range.
SSRANGE is a compiler option that handles the array overflow. SSRANGE also needs to be specified in COBOL programing language. These help in finding the subscript out of range.
NOSSRANGE is used for performance sensitive applications. NOSSRANGE is a default option that doesn’t support any runtime error if the index or subscript runs out of range.

Posted Date:- 2021-09-02 22:34:10

How Can I Tell If A Module Is Being Called Dynamically Or Statically?

The ONLY way is to look at the output of the linkage editor (IEWL) or the load module itself. If the module is being called DYNAMICALLY then it will not exist in the main module, if it is being called STATICALLY then it will be seen in the load module. Calling a working storage variable, containing a program name, does not make a DYNAMIC call. This type of call is known as IMPLICITE calling as the name of the module is implied by the contents of the working storage variable. Calling a program name literal.

Posted Date:- 2021-09-02 22:33:31

What guidelines should one follow while writing a structured COBOL-based program?

When writing a structured COBOL program, one must follow a certain format that allows the proper implementation of the code. For instance, when constructing a case, one can use EQUIVALENT statements each time. When nesting, use scope terminators, and when you want the program to do something, try and use IN-LINE PERFORM statements. People also use TEST BEFORE and TEST AFTER statements while coding for do-while loop statements.

Posted Date:- 2021-09-02 22:32:48

Differentiate between structured COBOL program and Object Oriented COBOL Program.

Structured programming is the logical way of writing a program where functions are divided into modules and tackled logically.

Object oriented programs are those where you write the methods and functions around the Object that is identified.

COBOL is a structured and a very user friendly programming language. It is one of the oldest programming language and the functionality it provides for big administrative systems cannot be easily replaced.

Posted Date:- 2021-09-02 22:32:13

What are the characteristics of COBOL as a business language?

COBOL is a business-oriented application. It has many characteristics that help businesses to manage and update data. Being a business language, COBOL can handle large data volumes. Programmers can compile, execute and bring together COBOL on many machines together. It can also be used for debugging and testing tools when somebody is looking for solutions. Different versions of COBOL enhance its features manifold.

Posted Date:- 2021-09-02 22:31:34

What kinds of errors are caught by the ON SIZE ERROR OPTION?

The following errors are trapped by the ON SIZE ERROR option:

Fixed point overflow
Number zero raised to power zero
Divide by zero
Number zero raised to power negative number
A negative number raised to the power of a fraction.

Posted Date:- 2021-09-02 22:31:01

What is the difference between Structured COBOL Programming and Object Oriented COBOL programming?

Structured programming is logical way of programming where the functionalities are divided into modules and helps write the code logically.

Object Oriented Cobol language is a Natural way of programming in which you identify the objects, and then write functions and procedures around that object.

Posted Date:- 2021-09-02 22:30:01

How Is Sign Stored In A Comp-3 Field?


It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc...

Posted Date:- 2021-09-02 22:29:15

How Is Sign Stored In Packed Decimal Fields And Zoned Decimal Fields?

Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits ) of the storage.

Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last bite.

Posted Date:- 2021-09-02 22:28:10

Can I Redefine An X(100) Field With A Field Of X(200)?

Yes. Redefines just causes both fields to start at the same location. For example:
01 WS-TOP PIC X(1)
01 WS-TOP-RED REDEFINES WS-TOP PIC X(2).
If you MOVE '12' to WS-TOP-RED,
DISPLAY WS-TOP will show 1 while
DISPLAY WS-TOP-RED will show 12.

Posted Date:- 2021-09-02 22:27:32

What Does Exit Do ?


Does nothing ! If used, must be the only sentence within a paragraph.

Posted Date:- 2021-09-02 22:27:00

What are INPUT PROCEDURE and OUTPUT PROCEDURE?

>> INPUT PROCEDURE- It defines the operations where input files are first opened. After opening, records are read, edited and altered. It then goes for sorting operations and finally the files are closed.
[plain]RELEASE recordname FROM inputrecord [/plain]

>> OUTPUT PROCEDURE- It defines the operations where output file is first opened and it receives the sorted record in output record. Then the file is written and finally closed.

Posted Date:- 2021-09-02 22:26:21

What kind of error is trapped by ON SIZE ERROR option?

ON SIZE ERROR happens in situations when the result of the arithmetic operation is larger than the fixed point field. It also happens when it is divisible by 0. Other situations that result in ON SIZE ERRORS are zero raised to zero, zero raised to some negative number or a negative number raised to a fractional power.

Posted Date:- 2021-09-02 22:25:20

Define static linking and dynamic linking.

There are two types of linking in COBOL: static linking and dynamic linking.

In static linking, subroutine links into the calling program and doesn’t exist as a separate module.

In the dynamic module, subroutine doesn’t link into the main program and exists as a separate module. DYNAM or NODYNAM link edit options can be used for static and dynamic linking.

Posted Date:- 2021-09-02 22:24:23

State the various causes of S0C1, S0C5, and S0C7.

S0C1 can be caused due to:
• A misspelled DD name.
• Read/Write to a dataset that is unopened.
• The subprogram called cannot be found.
• Read to the dataset for an opened output.
S0C5 can be caused due to:
• A bad or damaged Subscript/index.
• An incorrect exit from a preform.
• The I/O area is accessed before reading.
• An unopen dataset is closed.
S0C7 can be caused due to:
• A numeric operation is performed in a non-numeric data.
• Working storage is un-initialized.
• Excess coding past the max permitted dub script.

Posted Date:- 2021-09-02 22:23:31

When Would You Use In-line Perform?

When the body of the perform will not be used in other paragraphs. If the body of the perform is a generic type of code (used from various other places in the program), it would be better to put the code in a separate para and use PERFORM paraname rather than in-line perform.

Posted Date:- 2021-09-02 22:22:46

What is the function of REPLACING in a COPY statement?

REPLACING allows for the same copy to be repeated more than once in the same code just by replacing the value.

Posted Date:- 2021-09-02 22:22:19

Is COBOL still used, or is it still worth learning?

Yes, COBOL is still worth learning, irrespective of the fact whether the user or programmer wants to maintain them or port them to any other programming languages. With COBOL, it could be done easily. The language is more than 60 years old, but recently, there has been a rise in demand for this due to the requirements of some government agencies. Recently programmers have been using COBOL in state government operations to handle unemployment benefits amid the pandemic.

Posted Date:- 2021-09-02 22:20:59

What are the modes of File opening in COBOL?

The modes of opening a file in COBOL are OUTPUT, INPUT, I/O and EXTEND.

What is the extreme size of a mimetic field that can be defined in COBOL?

The maximum size of a numeric field that can be defined in COBOL is PIC 9(18).

Posted Date:- 2021-09-02 22:20:33

What is the point of the REPLACING option of a copy statement?

REPLACING allows for the same copy to be used more than once in the same code by changing the replace value.

COPY <Name> REPLACING BY

Posted Date:- 2021-09-02 22:09:26

What is Static and Dynamic linking?

In static linking, called subroutine links into the calling program, while in dynamic linking, the subroutine & the main program will exist as separate modules. Dynamic and Static linking can be achieved by choosing either the DYNAM or NODYNAM link edit option.

Posted Date:- 2021-09-02 22:08:34

What are the different OPEN modes available in Cobol?

Open modes can be used for

<> Input
<> Output
<> Input – Output
<> Extend

Posted Date:- 2021-09-02 22:08:04

What is the difference between performing a SECTION and performing a PARAGRAPH?

When you perform a SECTION, all paragraphs under the section will be performed. But if you are performing a paragraph, only the particular paragraph will be performed.

Posted Date:- 2021-09-02 22:07:25

What is the difference between CONTINUE & NEXT SENTENCE?

CONTINUE is like a null statement and it continues execution, while NEXT SENTENCE transfers control to the next sentence.

Posted Date:- 2021-09-02 22:06:55

What is the difference between performing a SECTION and a PARAGRAPH?

SECTION will have all the paragraphs that are part of the section, to be performed.

PARAGRAPH will have only that paragraph to be performed.

Posted Date:- 2021-09-02 22:06:27

What is AMODE(24), AMODE(31), RMODE(24) and RMODE(ANY)?

These are the options of compile/link editing:
AMODE: Addressing Mode.
• AMODE(24): It is a 24-bit addressing mode.
• AMODE(31): It is a 31-bit addressing mode.
• AMODE(ANY): Either 24 bit or 31-bit address mode depending upon RMODE.
RMODE: Resident mode.
• RMODE(24): It resides within virtual storage below 16 Meg line.
a. Programs of 31 bit which call 24-bit programs are preferred to use this mode.
b. RMODE(ANY): Either 24 bit or 31-bit address mode depending upon RMODE.
c. OS/VS COBOL program uses 24-bit address only.
• RMODE(ANY): This mode can reside below or above 16 Meg line.

Posted Date:- 2021-09-02 22:05:52

What is SOC-7 abend? What do you do to resolve SOC-7 error?

Many times the reason for SOC7 is an un-initialized numeric item.
a. Offending data need to be corrected, focus on examining this.
b. A lot of installations provide a dump for run time abends, and these abends provide the offset which is returned by the last instruction where the abend occurred.
c. Focus on examining the compilation output XREF listing to find the verb and the line number within the source code at this offset.
d. Later investigate the source code for finding the bug.
e. Define certain datasets(SYSABOUT etc) in JCL, for capturing runtime dumps.
f. At times few installations might have batch program debugging tool. Utilize them to resolve the issue.

Posted Date:- 2021-09-02 22:05:14

What Is The Use Of Evaluate Statement?


Evaluate is like a case statement and can be used to replace nested Ifs. The difference between EVALUATE and case is that no 'break' is required for EVALUATE i.e. control comes out of the EVALUATE as soon as one match is made.

Posted Date:- 2021-09-02 22:04:00

What Is The Difference Between Performing A Section And A Paragraph?

Performing a SECTION will cause all the paragraphs that are part of the section, to be performed.
Performing a PARAGRAPH will cause only that paragraph to be performed.

Posted Date:- 2021-09-02 22:03:36

What Should Be The Sorting Order For Search All?


It can be either ASCENDING or DESCENDING. ASCENDING is default. If you want the search to be done on an array sorted in descending order, then while defining the array, you should give DESCENDING KEY clause. (You must load the table in the specified order).

Posted Date:- 2021-09-02 22:02:46

What is the difference between a binary search and a sequential search?

In a binary search, the table element key values will be in ascending or descending sequence. The table is ‘halved'(Divided into two) to search for equal to, greater than or less than conditions until the element is found.
In a sequential search, the table is searched from top to bottom, so the elements do not have to be in a specific sequence.
The binary search is much faster for more tables, while sequential Search works well with lesser ones. SEARCH ALL is used for binary search; SEARCH for sequential search.

Posted Date:- 2021-09-02 22:02:13

What are various search techniques in COBOL? Explain. What is the difference between SEARCH and SEARCH ALL?

There are 2 searching techniques in COBOL.
Serial search: SEARCH
• It is a process of finding a particular value in a given list.
• The search is implemented by checking each element in the list, one at a time and in sequence.
• This process is continued until the desired element is found.
• SEARCH is used for serial search.
Binary Search: SEARCH ALL
• It is a process of finding a particular element in a sorted list.
• The binary search starts by comparing the middle element of the array.
• The comparison determines the element’s location – either in the first half of the list or in the second half of the list.
• This process continues until the search element is equal to the middle element of the list
• SEARCH ALL is used for binary search.
• The list must be sorted by using the ASCENDING / DESCENDING KEY clause, which loads.
• The default key is ASCENDING KEY.

Posted Date:- 2021-09-02 22:00:43

What Is The Difference Between Search And Search All?


SEARCH - is a serial search.
SEARCH ALL - is a binary search & the table must be sorted
ASCENDING/DESCENDING KEY clause to be used & data loaded in this order) before using SEARCH ALL.

Posted Date:- 2021-09-02 21:59:14

What Is The Difference Between Index And Subscript?

Subscript refers to the array occurrence while index is the displacement (in no of bytes) from the beginning of the array. An index can only be modified using PERFORM, SEARCH & SET.
Need to have index for a table in order to use SEARCH, SEARCH ALL.

Posted Date:- 2021-09-02 21:58:41

What is meant by IS NUMERIC clause?

The IS NUMERIC clause is used to check if an item is numeric or not. The value returned will be TRUE if the item that is checked for contains only numbers whether positive or negative.

Posted Date:- 2021-09-02 21:55:43

List a few features of the COBOL language

COBOL is a structured, standard programming language that can be compiled and executed on any machine. It is typically used in business applications as it can handle a large volume of data. It contains numerous debugging and testing capabilities.

Posted Date:- 2021-09-02 21:54:45

What are the different divisions of a COBOL program?

The various divisions of a COBOL program are IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION and PROCEDURE DIVISION.

Posted Date:- 2021-09-02 21:52:23

What are the different data types in COBOL?

There are three data types in Cobol:

1. Alpha-numeric (X)
2. Alphabetic (A) and
3. Numeric (9)

Posted Date:- 2021-09-02 21:51:36

What do you know about COBOL?

COBOL is the abbreviation for Common Business Oriented Language. It is among the old programming languages and is primarily used in finance, business and administrative systems and applications.

Posted Date:- 2021-09-02 21:49:59

Search
R4R Team
R4R provides COBOL Freshers questions and answers (COBOL Interview Questions and Answers) .The questions on R4R.in website is done by expert team! Mock Tests and Practice Papers for prepare yourself.. Mock Tests, Practice Papers,COBOL interview question set 1,COBOL Freshers & Experienced Interview Questions and Answers,COBOL Objetive choice questions and answers,COBOL Multiple choice questions and answers,COBOL objective, COBOL questions , COBOL answers,COBOL MCQs questions and answers R4r provides Python,General knowledge(GK),Computer,PHP,SQL,Java,JSP,Android,CSS,Hibernate,Servlets,Spring etc Interview tips for Freshers and Experienced for COBOL fresher interview questions ,COBOL Experienced interview questions,COBOL fresher interview questions and answers ,COBOL Experienced interview questions and answers,tricky COBOL queries for interview pdf,complex COBOL for practice with answers,COBOL for practice with answers You can search job and get offer latters by studing r4r.in .learn in easy ways .