1. What is COBOL?
COBOL is abbreviated as Common Business Oriented Language and it is one of the oldest programming languages. It primarily used for business, finance and administrative systems for companies.
2. Which division and paragraphs are mandatory for a COBOL program?
3. How do you specify and use a cursor in a COBOL program?
Use DECLARE CURSOR statement either in working storage or in procedure division ( before open cursor), to specify the SELECT statement. Then use OPEN, FETCH rows in a loop and finally CLOSE.
4. What is a synonym?
A synonym is an unqualified alternative name for a table or view.
5. What is a foreign key?
A foreign key is the key defined in one table to reference the primary key of a reference table. This foreign key must have the same structure as the reference table’s primary key.
6. What is referential integrity?
Referential integrity is the automatic enforcement of referential constrains that exist between a reference table and a referencing table. When referential integrity is enforced, the value of a foreign key exists as a primary key value in the reference table. In other words, when referential integrity is enforced, all of the foreign key values in, for example, the “department code” column in an “employee” table exist as primary key values in a “department” talbe.
7. How do you define a table/array in COBOL?
8. What is difference between COBOL and VS COBOL II?
9. How do you differentiate between COBOL and COBOL-II?
1. MVSXA and MVSESA support the compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode.
2. VMXA and VMESA support the compiler and the object programs it produces can be run in either24- or 31-bit addressing mode.
3. VSEESA supports the compiler and the object programs it produces can be run under VSEESA.
The following features are available with VS COBOL II
10. What is a correlation name?
A correlation name is a special type of column designator that connects specific columns in the various levels of a multilevel SQL query.
11. How to execute a set of JCL statements from a COBOL program?
12. How do you submit JCL via a COBOL program?
13. 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.
There are three types of declaratives used in COBOL.
- Exception: They are used for errors that occur in a file handling procedure.
- Debugging: As their name suggests, used for debugging lines with “D” code in w-s section.
- Label: they are used to indicate a beginning.
15. What is the difference between performing a SECTION and a PARAGRAPH?
PARAGRAPH will have only that paragraph to be performed.
16. What happens when you say OPEN CURSOR?
If there is an ORDER BY clause, rows are fetched, sorted and made available for the FETCH statement. Other wise simply the cursor is placed on the first row.
17. What is the difference between SEARCH and SEARCH ALL? What is more efficient?
SEARCH is a sequential search from the beginning of the table. SEARCH ALL is a binary search, continually dividing the table in two halves until a match is found. SEARCH ALL is more efficient for tables larger than 70 items.
18. What guidelines should be followed to write a structured COBOL prgm?
1) Use ‘evaluate’ stmt for constructing cases.
2) Use scope terminators for nesting.
3) Use in line performs stmt for writing ‘do ‘constructions.
4) Use test before and test after in the perform stmt for writing do-while constructions.
19. What is the difference between a binary search and a sequential search? What are the pertinent COBOL commands?
- In a binary search the table element key values must be in ascending or descending sequence.
- The table is ‘halved’ 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 (ironically) the elements do not have to be in a specific sequence.
- The binary search is much faster for larger tables, while sequential works well with smaller ones.
- SEARCH ALL is used for binary searches; SEARCH for sequential.