Introduction to COBOL
COBOL stands for Common Business Oriented Language. It is procedural, object-oriented, and imperative. A computer program called a compiler converts other computer programs written in high-level (source) languages into machine code, which the computer can understand. Data is input into a file or database, processed, and produced via COBOL. In a nutshell, COBOL receives data, computes it, and then produces the results.
Here is a list of top Cobol Interview questions. These Cobol interview questions are categorized into difficulty levels easy, medium, and hard.
Cobol Interview Questions for Freshers
Here are some introductory level Cobol interview questions that are frequently asked:
1. What do you know about Cobol?
COBOL is one of the oldest programming languages. It stands for Common Business Oriented Language and is mainly used for business verticals like government, banking, and administrative systems. It concentrates on resolving challenging commercial issues.
2. What is COBOL in ETL?
COBOL (Common commercial-Oriented Language) is primarily employed for commercial applications. Because it is effective at processing huge volumes of data, it is a common language for ETL (extract, transform, and load) procedures.
Data can be extracted using COBOL from many different sources, such as relational databases, flat files, and legacy systems. The data can then be transformed such that it complies with the destination system's criteria. The converted data can then be loaded into the target system through COBOL.
3. Is COBOL still in use or still valuable to learn?
Yes, COBOL is still valuable to learn. Even though the language is almost 60 years old, there has recently been an increase in demand because of the needs of some governmental organizations.
4. How many datatypes are there in COBOL?
There are 3 datatypes in COBOL: Numeric, Alphabetic, and Alpha-Numeric.
5. What is Z in COBOL?
"Z" is frequently used in COBOL as a format code for numeric data items. The acronym is "Zero Suppression." Leading zeros should not be displayed when showing a numeric data item when "Z" is specified in the PICTURE clause. For instance, using "Z" format code to show a numeric variable with a PICTURE clause of "9999" and a value of 0075 would display "75" without leading zeros.
6. What is DB & CR in COBOL?
In COBOL, "DB" stands for "Debit" and "CR" for "Credit." In financial applications, these are frequently used as prefixes for data objects that reflect monetary amounts. While credit quantities signify money being added or received, debit amounts signify money being taken out or spent. For instance, in a financial system, you might utilise variables like "DB-AMOUNT" and "CR-AMOUNT" to keep track of debit and credit transactions.
Must Recommended Topic, procedure call in compiler design
7. What is FD and SD in COBOL?
The COBOL statement FD (File Description) is used to specify the details of a file that the programme will read from or write to. The name of the file, the record structure, the access mode (such as sequential or random), and other file parameters are all specified.
SD (Sort Description): In COBOL, SD is used to define the properties of a merge or sort file. It specifies information such as the file name, record structure, and sort keys that will be applied during operations like sorting or merging.
8. What are data types in COBOL?
To define different kinds of data items, COBOL offers a variety of data types. Some typical COBOL data types are as follows:
Data types like INTEGER, COMP (binary), COMP-3 (packed decimal), and others are used for numerical data.
- Text data that is alphabetized comprises kinds like CHAR and STRING.
- Alphanumeric characters combine both alphabetic and numeric characters.
- Booleans are used for yes/no or true/false values; typically defined using "PIC X" or "PIC 9" with appropriate values.
- To work with date and time values we use Date and Time data types. COBOL offers data types like DATE and TIME.
- Group and Nested Data: Using the GROUP and REDEFINES clauses, COBOL enables you to group related data elements. This aids in the organisation of intricate data structures.
9. What is 01 to 49 level number in COBOL?
Levels 01 to 49 in COBOL are used to specify data structures and data objects. These levels show how the data pieces are nested or arranged in a hierarchy. Here is a general summary:
The top level, Level 01, is used to describe the primary record or data structure.
Levels 02 to 49: These levels are used to specify minor data items within the primary record. The nesting level is indicated by the level numbers. Level 02 items, for instance, are below level 01 items, level 03 items are beneath level 02 items, and so on.
In a COBOL programme, these levels aid in data organisation and structuring, making it simpler to work with complex data structures.
10. What distinguishes an index from a subscript?
Although an array's Subscript is known as its occurrence, an index describes the distance from the array's start. Only the commands PERFORM, SEARCH, and SET can be used to change an index.
11. What distinguishes a section from a paragraph?
There will be paragraphs that are a part of the section that has not yet been completed. At the same time, there will only be one paragraph to perform in the event of a paragraph.
12. What distinguishes NEXT SENTENCE from CONTINUE?
Control is passed to the following sentence with the word NEXT SENTENCE. CONTINUE continues execution and behaves like a null statement.
13. What divisions are there in a COBOL program?
The average COBOL program has four divisions. Identification, environment, data, and process are what we refer to as these. The identification section is the most crucial one because it defines the program. Configuration and input-output make up the two sections of the environment division. It establishes the program's environment.
14. What function does the verb ACCEPT serve?
The word ACCEPT is a fundamental statement in COBOL that is used to get information like time, date, and day from the user or program. When receiving information for a student record in educational data, the verb ACCEPT, and the word DISPLAY is employed.
15. Explain Static and dynamic linking.
In static linking, subroutine links are invoked by the calling program. The main program and the subroutine can both live as different modules when using dynamic linking. Selecting the DYNAM or NODYNAM link edit options will allow you to link in both dynamic and static content.