HOME JCL COBOL DB2 VSAM CICS


COBOL Interview Questions

21. How do we get current date from system with century?
Current date with the century is achieved by using Intrinsic function called FUNCTION CURRENT-DATE.

22. What are all the divisions of a COBOL program?
There are four divisions in a cobol program:IDENTIFICATION DIVISION, ENVIRONMENT DIVISION, DATA DIVISION and PROCEDURE DIVISION

23. What is a SSRANGE and NOSSRANGE?
These are options for a compiler to find the subscript out of range. NOSSRANGE is the default option where there will not be any run time error if index or subscript went out of a range.

24. What is COMP-1? COMP-2?
COMP-1 is a Single precision floating point and uses four bytes. COMP2 is the double precision floating number and uses eight bytes.

25. 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.

26. What is the Purpose of Pointer in the string?
The Purpose of Pointer is to specify the leftmost position within receiving field where the first transferred character will be stored.

27. What is binary search?
First, we have to compare the item to be searched with the item at the center.If it matches, it is good to go with the value else repeat the process with the left half or the right half depending on where the item lies.

28. What is the difference between a binary search and a sequential search?
In a binary search, the table element key values will be in ascending or descending sequence. The table is 'halved'(Divided into two) 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 the elements do not have to be in a specific sequence.The binary search is much faster for more tables, while sequential Search works well with lesser ones. SEARCH ALL is used for binary search; SEARCH for sequential search.

29. Can a Search can be done on a table with or without Index?
No, the table must be indexed to search on a table.

30. Which is the default, TEST BEFORE or TEST AFTER for a PERFORM statement?
TEST BEFORE is the default statement and the condition is checked before executing the instructions under Perform.

1 2 3 4 5
Copyright 2020 by ibmmainframer. All Rights Reserved.