Divisions Interview Questions
What is a significance of division?
A division is a collection of one or more sections and paragraphs. Division begins with the division name and ends at the beginning of the subsequent division or the program ends.
Name the divisions in a COBOL program?
COBOL has 4 system-defined divisions. They are -
- IDENTIFICATION DIVISION
- ENVIRONMENT DIVISION
- DATA DIVISION
- PROCEDURE DIVISION
IDENTIFICATION DIVISION -
What is the purpose of IDENTIFICATION DIVISION?
It provides metadata about the program, such as its name, author, installation, and other descriptive information used to uniquely identify it.
What is the purpose of a program-id in COBOL?
PROGRAM-ID entry is used to specify the program name. It is mandatory and should be the first entry in the IDENTIFICATION DIVISION.
What are the mandatory paragraphs in IDENTIFICATION DIVISION?
PROGRAM-ID is the mandatory paragraph apart from IDENTIFICATION DIVISION.
ENVIRONMENT DIVISION -
Describe the role of the ENVIRONMENT DIVISION in a COBOL program and its importance in handling computing environment dependencies?
It is responsible for specifying the computer environment (mostly computer name in mainframe environment) on which the program is compiled and executed. In addition, it defines the input and output sources (files) required to run the program and interact with devices like printers, files, etc.
What is the usage of CONFIGURATION section in ENVIRONMENT DIVISION?
It describes the computer environment in which the program is compiled and executed.
What is usage of SOURCE-COMPUTER in ENVIRONMENT DIVISION?
It provides the computer name on which the source program is compiled.
What is the significance of DEBUGGING MODE with SOURCE-COMPUTER?
It activates a compile-time debugging switch for debugging lines coded in the program.
What is the usage of INPUT-OUTPUT section in ENVIRONMENT DIVISION?
It specifies the input and output sources information that is useful to access the resources outside the program.
What is the usage of FILE-CONTROL paragraph?
It contains complete information about the files used in the program and it maps the logical file (used in program) to the corresponding physical file which is external to the program.
What is the usage of I-O CONTROL paragraph?
It specifies the resuming points from where the rerun will be started and the memory area that different files will share.
DATA DIVISION -
Explain role of the data division in COBOL programs?
It is responsible for declaring the variables used to process the data in the application program.
How many Sections are there in Data Division?
There are 3 sections in DATA DIVISION. They are -
- FILE SECTION
- WORKING-STORAGE SECTION
- LINKAGE SECTION
What are the mandatory things in DATA DIVISION?
DATA DIVISION itself optional if no variable is declared in the program.
What is the file section used for in COBOL programming?
FILE SECTION provides a reliable and standardized approach to file management. It contains all logical structures of the files used in the program.
What is a working-storage section in COBOL?
It is used to declare all the variables and record structures required for processing data in the program.
What is the linkage section?
It declares the variables used to pass data between COBOL programs or receive data from run JCL.
What is LOCAL-STORAGE SECTION?
It defines storage that is allocated and freed on usage basis.
PROCEDURE DIVISION -
What is a procedure division in COBOL?
The actual logic will be written in PROCEDURE DIVISION, which is responsible for carrying out the data processing tasks. Program execution starts from PROCEDURE DIVISION and ends with STOP RUN or GO BACK statements.
Where we can declare the DECLARATIVES in COBOL program?
Declarative is used to code one or more special-purpose sections executed when an exceptional condition occurs.
Common Questions -
What divisions, sections and paragraphs are mandatory in a COBOL program?
Below are mandatory in COBOL programs -
- IDENTIFICATION DIVISION, PROGRAM-ID paragraph
- PROCEDURE DIVISION
Frequently Asked Questions -
Explain all the divisions in a COBOL program?
What are the different divisions in COBOL programs?
List down the divisions that are available in a COBOL program?
What are the four divisions in COBOL?
What are all the divisions of a COBOL program?
What are the four divisions in the COBOL language structure?
Explain the function of ENVIRONMENT DIVISION and its significance for managing dependencies in the computer environment?
What is the resolution of using the ENVIRONMENT DIVISION in programming?
Define ENVIRONMENT DIVISION in the COBOL language structure?
Explain the usage of the ENVIRONMENT DIVISION in programming?
Determine the task of using the input section in programming
How the input section plays a crucial role in programming?
Explain the service of using the data division in programming?
List down the sections available in Data Division in COBOL?
Name the sections of the data division?
Where does the FILE-CONTROL paragraph appear?
What is the use of linkage section?
In which division, Linkage Section comes?
Why is the LINKAGE SECTION required?
What is the LINKAGE SECTION used for?
What is the role of the LINKAGE SECTION?
What makes a LINKAGE SECTION necessary?
What is the linkage section, and what do you use it for?
Explain the linkage section used for in COBOL programming?
What is the use of the LINKAGE SECTION in COBOL, and how can it be used to share data between subprograms?
What is the usage of declaratives in procedure division in COBOL?
Which division and paragraphs are mandatory for a COBOL program?
In a COBOL program, which division and paragraphs are required?
What division and paragraphs are mandatory when writing a COBOL program?
Which is the mandatory division in COBOL program?
Which components are mandatory for a COBOL program?