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

82⟩ What is COMP-1 and COMP-2?

COMP-1 - Single precision floating point. It uses 4 bytes.

COMP-2 - Double precision floating point. It uses 8 bytes.

 197 views

85⟩ What do you do to resolve SOC-7 error?

Basically you need to correct the offending data. Many times the reason for SOC7 is an un-initialized numeric item. Examine that possibility first. Many installations provide you a dump for run time ABEND’s (it can be generated also by calling some subroutines or OS services thru assembly language). These dumps provide the offset of the last instruction at which the ABEND occurred. Examine the compilation output XREF listing to get the verb and the line number of the source code at this offset. Then you can look at the source code to find the bug. To get capture the runtime dumps, you will have to define some datasets (SYSABOUT etc) in the JCL. If none of these are helpful, use judgment and DISPLAY to localize the source of error. Some installation might have batch program debugging tools. Use them.

 193 views

87⟩ What the difference is between CONTINUE and NEXT SENTENCE?

They appear to be similar, that is, the control goes to the next sentence in the paragraph. But, Next Sentence would take the control to the sentence after it finds a full stop (.). Check out by writing the following code example, one if sentence followed by 3 display statements (sorry they appear one line here because of formatting restrictions) If 1 > 0 then next sentence end if display ‘line 1' display ‘line 2' display ‘line 3'. *** Note- there is a dot (.) only at the end of the last 2 statements, see the effect by replacing Next Sentence with Continue ***

 201 views

88⟩ 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.

 219 views

90⟩ What is the difference between a binary search and a sequential search what are the pertinent COBOL?

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.

 237 views

94⟩ What is an in line PERFORM When would you use it anything else to say about it?

The PERFORM and END-PERFORM statements bracket all COBOL II statements between them. The COBOL equivalent is to PERFORM or PERFORM THRU a paragraph. In line, PERFORM’s work as long as there are no internal GO TOs, not even to an exit. The in line PERFORM for readability should not exceed a page length - often it will reference other PERFORM paragraphs.

 207 views

98⟩ Explain how will you differentiate 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.

 224 views

99⟩ How can you submit a job from COBOL programs?

Write JCL cards to a dataset with xxxxxxx SYSOUT= (A, INTRDR) where ‘A’ is output class, and dataset should be opened for output in the program. Define a 80 byte record layout for the file.

 179 views