Cobol

  Home  Computer Programming  Cobol


“Cobol Interview Questions and Answers will guide us now that COBOL is one of the oldest programming languages in computer history. COBOL name is an acronym for COmmon Business-Oriented Language, defining its primary domain in business, finance, and administrative systems for companies and governments. Learn COBOL programming basic and advance concepts or get preparation of COBOL based jobs interview by our this Cobol Interview Questions and Answers Guide.”



110 Cobol Questions And Answers

61⟩ What are 77 levels used for?

It is used in Elementary level item. It cannot be subdivisions of other items (cannot be qualified), nor can they be subdivided themselves.

 152 views

63⟩ What does the INITIALIZE verb do?

Alphabetic, Alphanumeric fields & alphanumeric edited items are set to SPACES. Numeric, Numeric edited items set to ZERO. FILLER OCCURS DEPENDING ON items left untouched.

 138 views

66⟩ What are the types of record locks and how are they set?

Locks may be shared or exclusive. Shared means that other run units can retrieve the record but cannot modify it. Exclusive means that other run units can neither retrieve nor modify it. Record locks may be implicit or explicit. Implicit locks are set in the ready statement usage clause. Explicit locks are set using either the keep statement or keep option of the find/obtain command.

 124 views

67⟩ What is an area sweep and when is it used?

An area sweep accesses records based on the physical location in a database area. It can be total, meaning a record-by-record search of the area, or it can be of occurrences of records of a specific type.

 139 views

69⟩ How you can read the file from bottom?

The question is very general. Let us look into these possibilities:

1. QSAM (sequential) file: You can run it thru SORT utility adding SEQNUM and then sort then sort by SEQNUM in DESC order

2. VSAM: In CICS, you can read backward using READREV;

3. VSAM: I Batch, unload the VSAM file using SORT in DESC order by key value

 132 views

71⟩ What is a bind?

Binding is a process that creates the access path logic for the sql statements within a COBOL program. After precompilation of a COBOL program a dbrm (has all the embedded sql statements) is created. This dbrm is then bound to form a plan (executable form of the sql statements).

 139 views

72⟩ What is the difference between Structured COBOL Programming and Object Alternativelyiented COBOL?

Structured programming is a Logical way of programming, you divide the functionalities into modules and code logically. OOP is a Natural way of programming; you identify the objects first, and then write functions, procedures around the objects. Sorry, this may not be an adequate answer, but they are two different programming paradigms, which is difficult to put in a sentence or two.

 167 views

73⟩ Is it possible that the REDEFINES clause has different picture clauses compared to the one it redefined?

Yes, we can have different PIC clauses.

E.g.:

05 REGULAR-EMPLOYEES

10 LOCATION PICTURE A(8)

10 GRADE PICTURE X(4)

10 SEMI-MONTHLY-PAY PICTURE 9999V99

10 WEEKLY-PAY REDEFINES SEMI-MONTHLY-PAY

PICTURE 999V999

05 TEMPORARY-EMPLOYEE REDEFINES REGULAR-EMPLOYEE

10 LOCATION PICTURE A(8)

10 FILLER PICTURE X(6)

10 HOURLY-PAY PICTURE 99V99

 154 views

75⟩ What are the different forms of EVALUATE statement?

EVALUATE SQLCODE ALSO FILE-STATUS

WHEN A=B AND C=D WHEN 100 ALSO ‘00'

imperative stmt imperative stmt

WHEN (D+X)/Y = 4 WHEN -305 ALSO ‘32'

imperative stmt imperative stmt

WHEN OTHER WHEN OTHER

imperative stmt imperative stmt

END-EVALUATE END-EVALUATE

EVALUATE SQLCODE ALSO A=B EVALUATE SQLCODE ALSO TRUE

WHEN 100 ALSO TRUE WHEN 100 ALSO A=B

imperative stmt imperative stmt

WHEN -305 ALSO FALSE WHEN -305 ALSO (A/C=4)

imperative stmt imperative stmt

 157 views

76⟩ What is PERFORM what is VARYING?

The PERFORM statement is a PROCEDURE DIVISION statement which transfers control to one or more specified procedures and controls as specified the number of times the procedures are executed. After execution of the specified procedures is completed (i.e., for the appropriate number of times or until some specified condition is met), control is transferred to the next executable statement following the PERFORM statement. There are 5 types of PERFORM statements

* a) Basic PERFORM

* b) PERFORM TIMES

* c) PERFORM UNTIL

* d) PERFORM VARYING

* e) IN-LINE PERFORM

 149 views

77⟩ How do you differentiate between COBOL and COBOL-II?

The following features are available with VS 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.

 157 views

79⟩ How is sign stored in a comp-3 field?

It is stored in the last nibble. For example if your number is +100, it stores hex 0C in the last byte, hex 1C if your number is 101, hex 2C if your number is 102, hex 1D if the number is -101, hex 2D if the number is -102 etc…

 141 views