InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
If 123 value is moved to a PP999 PIC clause, then what is edited value taken? |
|
Answer» .00123 edited value will be taken. P is assumed decimal scaling position which is used to specify the location of an assumed decimal point when the point is not within the number that appears in the data item. .PIC PP999 means that numeric data item is of 3 characters and there are 5 positions after the decimal point. |
|
| 2. |
What are literals? |
|
Answer» A literal is a data item that consists value by itself. It cannot be referred by a name. They are constant data items. |
|
| 3. |
Why is it necessary to open a file in I-O mode for REWRITE? |
|
Answer» Before REWRITE is performed, the record must be opened and read from the file. Therefore, the file must be opened in I-O mode for rewrite functionality. |
|
| 4. |
Can a Search be done on a table with or without Index? |
|
Answer» No, the table must be indexed to search on a table. |
|
| 5. |
What is the difference between PIC 9.99 and PIC9v99? |
|
Answer» PIC 9.99 is a four position field that actually contains a decimal point whereas PIC 9v99 is a three position numeric field with assumed decimal position. |
|
| 6. |
What are the access modes of START statement? |
|
Answer» Access modes are SEQUENTIAL or DYNAMIC for the start statement. |
|
| 7. |
What is LOCAL-STORAGE SECTION? |
|
Answer» Local-Storage is allocated each time a program is called and will be deallocated when the program stops via an EXIT PROGRAM, GOBACK, or STOP RUN. It is defined in the DATA DIVISION after the WORKING-STORAGE SECTION. |
|
| 8. |
What is the difference between Perform With Test After and Perform With Test Before? |
|
Answer» If TEST BEFORE is specified, the condition is tested at the beginning of each repeated execution of the specified PERFORM range. If TEST AFTER is specified, the condition is tested at the end of each repeated execution of the PERFORM range. The range is executed at least once in TEST AFTER. |
|
| 9. |
Where does the FILE-CONTROL paragraph appear? |
|
Answer» It appears in the Input-Ouput Section in the Environment Division. |
|
| 10. |
Where does AREA B in COBOL start from? |
|
Answer» Area B starts from 12 to 72 column. |
|
| 11. |
What divisions, sections and paragraphs are mandatory in a COBOL program? |
|
Answer» Identification Division and Program-Id paragraph are mandatory in a COBOL program. |
|
| 12. |
How do you define the files referred to in a subroutine program? |
|
Answer» Supply the DD cards in JCL just as you would for files referred to in the main program. |
|
| 13. |
What is a Compute Statement? |
|
Answer» Compute statement is used to write arithmetic expressions in COBOL. This is a replacement for Add, Subtract, Multiply, and Divide. |
|
| 14. |
What is the function of Accept Verb? |
|
Answer» Accept Verb is used to get data such as date, time, and day from the operating system or directly from the user. If a program is accepting data from the user, then it needs to be passed through the JCL. |
|
| 15. |
What is COMP-1 and COMP-2? |
|
Answer» COMP-1 is single precision floating point that uses 4 bytes. COMP-2 is double precision floating point that uses 8 bytes. |
|
| 16. |
Can I redefine an X(10) field with a field of X(20)? |
|
Answer» Yes, as Redefines causes both fields to start at the same location. |
|
| 17. |
What is the use of EVALUATE statement? |
|
Answer» Evaluate is like a case statement and can be used to replace nested Ifs. No break is required as the control comes out as soon as a match is found. |
|
| 18. |
What is 77 level used for? |
|
Answer» It is an elementary level item which cannot be subdivided. |
|
| 19. |
What is the Purpose of Pointer Phrase in STRING command? |
|
Answer» The Purpose of Pointer phrase is to specify the leftmost position within the receiving field where the first transferred character will be stored. |
|
| 20. |
What is Redefines clause? |
|
Answer» Redefines clause is used to allow the same storage allocation to be referenced by different data names. |
|
| 21. |
What is the difference between static call and dynamic call? |
|
Answer» In static call, the called program is a standalone program, it is an executable program. During runtime, we can call it in our called program. As about dynamic call, the called program is not an executable program; it can be executed through the called program only. |
|
| 22. |
What is the purpose of Identification Division? |
|
Answer» Identification Division is used for documentation purpose. |
|
| 23. |
What is the difference between comp and comp-3? |
|
Answer» Comp is a binary usage, while comp-3 indicates packed decimal. |
|
| 24. |
How is sign stored in a COMP-3 field? |
|
Answer» It is stored in the last nibble. |
|
| 25. |
What will happen if you code GO BACK instead of STOP RUN in a stand alone COBOL program? |
|
Answer» The program will go in an infinite loop. |
|
| 26. |
What is a linkage section? |
|
Answer» The linkage section is a part of a called program that 'links' or maps to data items in the calling program's working storage. |
|
| 27. |
What is the difference between Call By Content and Call By Reference? |
|
Answer» The parameters passed in a Call By Content are protected from modification by the called program. In Call By Reference, parameters can be modified by the called program. |
|
| 28. |
What is the mode in which you will OPEN a file for writing? |
|
Answer» To write into a file, the file has to be opened in either OUTPUT or EXTEND mode. |
|
| 29. |
Why we cannot define an Occurs clause at 01 level? |
|
Answer» 01 is of the record level. We repeat the fields within a record, not the record itself. So an Occurs clause can not be used at 01 level. |
|
| 30. |
What is the maximum size of a numeric field we can define in COBOL? |
|
Answer» The maximum size of a numeric field is PIC 9(18). |
|
| 31. |
What are the file opening modes in COBOL? |
|
Answer» File opening modes in COBOL include: INPUT, OUTPUT, I-O, and EXTEND. |
|
| 32. |
What is the difference between SEARCH and SEARCH ALL? |
|
Answer» SEARCH is a serial search, whereas SEARCH ALL is a binary search. A table must be in sorted order before using SEARCH ALL. |
|
| 33. |
What is the difference between subscript and index? |
|
Answer» Subscript is the occurrence in an array. Index is the displacement from the beginning of an array. |
|
| 34. |
What are 66 and 88 level used for? |
|
Answer» Level 66 is used for RENAMES clause and Level 88 is used for condition names. |
|
| 35. |
What is 'IS NUMERIC' clause? |
|
Answer» IS NUMERIC clause is used to check if any item is numeric or not. It returns TRUE when the item against which it is used contains only numbers (0 to 9). The item can be positive or negative. |
|
| 36. |
What are the different data types available in COBOL? |
|
Answer» Alpha-numeric (X), Alphabetic (A), and Numeric (9). |
|
| 37. |
Name the divisions in a COBOL program. |
|
Answer» Identification Division, Environment Division, Data Division, and Procedure Division. |
|
| 38. |
List some features of COBOL. |
|
Answer» COBOL is a standard language that can be compiled and executed on various machines. It is ideally suited for business-oriented applications as it can handle huge volumes of data. It provides numerous debugging and testing tools. COBOL is a structured language; it has different divisions, so it is easy to debug. |
|
| 39. |
What do you know about COBOL? |
|
Answer» COBOL stands for Common Business-Oriented Language. The US Department of Defense, in a conference, formed CODASYL (Conference on Data Systems Language) to develop a language for meeting business data processing needs which is now known as COBOL. |
|