Top Most Cobol And DB2 Interview Questions Part – 11
What Is Binary Search?
Compare the item to be searched with the item at the centre. If it matches fine else repeat the process with the left half or the right half depending on where the item lies.
What Is The Use Of Evaluate Statement?
Evaluate is like a case statement and can be used to replace nested Ifs. No break is required as the control comes out as a soon as match is found.
Can I Redefine An X(10) Field With A Field Of X(20)?
Yes, as Redefines causes both fields to start at the same location.
What Is Comp-1 And Comp-2?
COMP-1 is single precision floating point that uses 4 bytes. COMP-2 is double precision floating point that uses 8 bytes.
What Is The Function Of Accept Verb?
Accept Verb is used to get data such as date, time, and day from 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.
What Is A Compute Statement?
Compute statement is used to write arithmetic expressions in COBOL. This is a replacement for Add, Subtract, Multiply, and Divide.
How Do You Define The Files Referred To In A Subroutine Program?
Supply the DD cards in JCL just as you would for files referred to in the main program.
What Divisions, Sections And Paragraphs Are Mandatory In A Cobol Program?
Identification Division and Program-Id paragraph are mandatory in a COBOL program.
Where Does Area B In Cobol Start From?
Area B starts from 12 to 72 column.
Where Does The File-control Paragraph Appear?
It appears in the Input-Ouput Section in the Environment Division.
What Is The Difference Between Perform With Test After And Perform With Test Before?
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.
What Is Local-storage Section?
Local-Storage is allocated each time a program is called and will be de-allocated when the program stops via an EXIT PROGRAM, GOBACK, or STOP RUN. It is defined in the DATA DIVISION after the WORKING-STORAGE SECTION.
What Are The Access Modes Of Start Statement?
Access modes are SEQUENTIAL or DYNAMIC for the start statement.
What Is The Difference Between Pic 9.99 And Pic9v99?
PIC 9.99 is a four position field that actually contains a decimal point where as PIC 9v99 is three position numeric field with assumed decimal position.
Why Is It Necessary To Open A File In I-o Mode For Rewrite?
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.