You are on page 1of 5

1. What do you know about COBOL?

Commonly known as Common Business Oriented Language, COBOL is


one of the oldest programming languages used mainly for various business
verticals, including government functions, finance, and administrative
systems. It focuses on solving complex business problems.

2. 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.

3. What are the different data types of COBOL language?


There are three main data types in COBOL:

Numeric (X) – This is used to represent numeric values between 0-9 in


COBOL programming

Alphabetic – This type of COBOL can hold any of the alphabetic variables
ranging between A-Z

Alpha Numeric – This data type can hold both values together, be it
alphabetic or numeric.

4. What is the difference between index and subscript?


Though Subscript is known as the occurrence of an array, an index refers
to the displacement from the array’s beginning. One can only modify an
index by using PERFORM, SEARCH & SET.

5. What is the difference between a section and a paragraph?


In a section, there will be all the paragraphs that are part of the section yet
to be performed. While in the case of a paragraph, there will only be a
paragraph to be performed.

6. What is the difference between NEXT SENTENCE & CONTINUE?


NEXT SENTENCE is used for transferring control to the next sentence.
CONTINUE acts like a null statement, and it continues execution

7. 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. 

8. 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.

9. What are the divisions in a COBOL program?


There are around four divisions in a COBOL program. These are known as
identification, environment, data and procedure. The identification is the
most important division as it identifies the program. The environment
division is divided into two sections, configuration and input-output.  It
defines the environment of the written program. The data division is used to
identify data items, allocate memories, and define names within the
program. It has a file, working storage and linkage section. The procedure
division supports the logic behind the program. It must have at least one
statement for using variables defined by the user.

10. What is the role played by the ACCEPT verb?


The ACCEPT verb is a basic statement used in COBOL for retrieving data
like time, date and day from the user or program. In the educational data,
ACCEPT verb and DISPLAY are used to receive information for a student
record.

11.  What are static and dynamic linking?


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

12.  What is the application of EVALUATE statement?


Evaluate is like a case statement. It can be used like Nested IFs. There is a
difference between EVALUATE and case. In EVALUATE, ‘break’ is not
used, and the control comes out of the EVALUATE once a match is found.

13.  What is the significance of the REPLACING option of a copy statement?


The REPLACING option allows for the same copy to be used many times;
it changes the replace value in the same code.

The coding used is COPY <Name> REPLACING BY

14. What is the role played by the ON SIZE ERROR option in trapping


error?
ON SIZE ERROR option is used in the following cases:

fixed-point overflow

Zero raised to the zero power


Division by 0

Zero raised to a negative number

A negative number raised to a fractional power

15. What are the differences between Structured COBOL Programming and


Object-Oriented COBOL programming?
Structured programming can be defined as a logical way of programming.
In this, the functionalities are divided into modules and help the
programmer to write the code logically.

Object-Oriented COBOL is a natural way of programming. In this,


programmers identify the objects and then write functions and procedures
around that object.

16. How can you define LOCAL-STORAGE SECTION?


Each time the program is called, Local-Storage is allocated, and then it is
deallocated when the program stops via an EXIT PROGRAM, GOBACK, or
STOP RUN. It is defined in the DATA DIVISION after WORKING-
STORAGE SECTION.

17. How can you define INPUT PROCEDURE and OUTPUT PROCEDURE?


During the INPUT PROCEDURE, the input file is opened, records are read
and edited. These records are then released to the sorting operation.
Finally, the file will be closed.

While in the OUTPUT PROCEDURE, the output file is opened, the sorted
record is returned to the Output record, and then the record will finally be
written. After this, the file will be closed.

18. What is the application of LINKAGE SECTION?


The linkage section is used to pass data from one program to the other or
pass data from a procedure to a program. It is part of a program that maps
data items in the calling program’s working storage.

19. Define access modes of START statement?


Access modes are defined as SEQUENTIAL or DYNAMIC for the start
statement.

20. Define an in-line PERFORM?


Through an IN-LINE PERFORM statement, the routine is being performed
to be nested within the perform statement instead of being a separate
paragraph.

While the PERFORM and END-PERFORM statements are used to block


the COBOL statements between them, in line PERFORM work as long as
there are no internal GO TOs, not even to an exit. 

You might also like