COBOL is a high-level programming language first developed by the CODASYL Committee (Conference on Data Systems Languages) in 1960. The word COBOL is an acronym that stands for COmmon Business Oriented Language. As the the expanded acronym indicates, COBOL is designed for developing business, typically file-oriented, applications. It is not designed for writing systems programs. For instance you would not develop an operating system or a compiler using COBOL.The COBOL 2002 standard includes support for object-oriented programming and other modern language features.
COBOL Interviews are getting tough these days as the technology grows faster. To get through the COBOL interview one needs to update him/herself in a regular manner. Having said that, just before the interview, it is very important to have a quick glance of the reputed COBOL questions and answers to make yourself comfortable during the interview process. This is where DoAnswers.com helps you in renewing yourself on COBOL and various other technologies interview preparation.
1. Can I redefine an X(100) field with a field of X(200)?
Yes. Redefines just causes both fields to start at the same location. For example:01 WS-TOP PIC X(1) 01 WS-TOP-RED REDEFINES WS-TOP PIC X(2). If you MOVE '12' to WS-TOP-RED, DISPLAY WS-TOP will show 1 while DISPLAY WS-TOP-RED will show 12.
2. Can I redefine an X(200) field with a field of X(100) ?
Yes.
3. Can JUSTIFIED be used for all the data types?
No, it can be used only with alphabetic and alphanumeric data types.
4. Can the OCCURS clause be at the 01 level?
No.
5. Can you call an OS VS COBOL pgm from a VS COBOL II pgm ?
In non-CICS environment, it is possible. In CICS, this is not possible.
6. Describe the difference between subscripting and indexing ?
Indexing uses binary displacement. Subscripts use the value of the occurrence.
7. Difference between next and continue clause
The difference between the next and continue verb is that in the continue verb it is used for a situation where there in no EOF condition that is the records are to be accessed again and again in an file, whereas in the next verb the indexed file is accessed sequentially, read next record command is used.
8. Differentiate COBOL and COBOL-II. (Most of our programs are written in COBOLII, so, it is good to know, how, this is different from COBOL)
The following features are available with VS COBOL II:
1. MVS/XA and MVS/ESA support The compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode.
2. VM/XA and VM/ESA support The compiler and the object programs it produces can be run in either 24- or 31-bit addressing mode.
3. VSE/ESA support The compiler and the object programs it produces can be run under VSE/ESA.
9. Explain call by context by comparing it to other calls.
The parameters passed in a call by context are protected from modification by the called program. In a normal call they are able to be modified.
10. Explain the difference between an internal and an external sort, the pros and cons, internal sort syntax etc.
An external sort is not COBOL; it is performed through JCL and PGM=SORT. It is understandable without any code reference. An internal sort can use two different syntax's:
1) USING, GIVING sorts are comparable to external sorts with no extra file processing;
2) INPUT PROCEDURE, OUTPUT PROCEDURE sorts allow for data manipulation before and/or after the sort.