COBOL interview questions
COBOL is a versatile platform for the developers as they find their application in a lot of fields such as finance, administration etc. In case you are an aspirant who is seeking for jobs as a COBOL developer, you need to solve every possible question an interviewer can ask.
Here is a set of both basic and advanced level questions that may appear in your interview.
1. Define COBOL?
2. Write some characteristics of COBOL as means of business language.
- It can be compiled, executed and brought together on various machines.
- It can handle large volumes of data and it is a business-oriented applications.
- It offers several debugging and testing tools for business users as it has several versions that make it easy to debug.
- It is a structured language.
3. What are different data types in COBOL?
- Alpha-numeric (X)
- Alphabetic (A,B,C)
- Numeric (1,2,3)
4. Define static linking and dynamic linking.
5. What kind of error is trapped by ON SIZE ERROR option?
6. Differentiate between Structured COBOL programming and object-oriented COBOL programming.
|Structured COBOL Programming||Object Oriented COBOL Programming|
7. 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.
[plain] RELEASE recordname FROM inputrecord[/plain]
8. Define in-line PERFORM?
9. Mention the guidelines to write a structured COBOL program?
- In order to construct case, one has to use EQUIVALENT statements every time.
- Scope terminators are used for nesting.
- IN-LINE PERFORM statements are used for writing ‘do’ constructions. Also, use Test before and Test after in perform statements while writing do-while statements.
10. Write down the divisions of COBOL program?
- Identification division- It is the most important division in the COBOL program. It is used for identifying the program.
- Environment division- This division defines the environment for which the COBOL program is written. It consists of two sections: configuration section and input-output section.
- Data identification- It is a place which describes the data items, defines the names that are used in the program and also allocates memories as required by the program. It consists of three sections: file section, working-storage section and linkage section.
11. What is the difference between binary search and sequential search?
In sequential search, the elements are in random positions because they are searched from top to bottom and not in a specific direction. As such they don’t follow a specific sequence. Sequential search is conducted for lesser number of tables and SEARCH command is used here.
12. What are the different rules for performing SORT operation?
- Input and output files must be closed. Input file is the file which has to be sorted in a particular sequence. Output file is the result that we get after the sorting process. We have to make sure that both these files are closed during SORTING process.
- SELECT clause should be present in working files. Work files are used for holding records during sorting process.
- Input and output files must have FD entries.
- Also, short descriptions should be there in file section of work files.
13. Name the sections present in data division.
- File section- It defines the fields within the records of each file in the program.
- Working storage section- It defines the names of the data that the program uses for manipulation of data.
- Screen section – It is used when the program does inout through forms.
- Report section- It is used for preparing reports.
- Linkage section.
- Local storage section- It is used for calling COBOL program.
14. How to know whether the module is dynamical or statistical?
15. what is the use of INTIALIZE verb?
16. When is a scope terminator mandatory?
17. For REWRITE, why is it mandatory that file needs to be opened?
18- what are the different rules to perform a search?
- The table must have OCCURS clause present in it.
- It should be INDEXED BY phrase.
- There should be some initial value present in search index.
- Always set the index value to 1.
19. What is a SSRANGE and NOSSRANGE?
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.
20. What is the difference between NEXT SENTENCE and CONTINUE in COBOL programing language?
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.
Thus, there are several inbuilt functions in this programming language which finds application in many verticals. Make sure you have all the basic and advanced knowledge before appearing for your interview to grab your dream job.