Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

1.

What are the object oriented features provided in COBOL?

Answer»

Object-Oriented COBOL provides the following features:

  • DEFINE classes and let programs define and create objects of those classes.
  • Data encapsulation is due to the ABILITY to create objects. The data properties will be encapsulated in the objects.
  • Behaviour of objects can be defined for the class by means of methods.
  • Inheritance is supported in COBOL.
  • Provides maximum FLEXIBILITY by means of polymorphism and defining interfaces.
  • Also compatible with procedural PROGRAMMING.
2.

What do you understand by static and dynamic linking?

Answer»

STATIC and dynamic LINKING are two types of linking available in COBOL. Static linking refers to the linking of subroutine into calling program and not existing as a separate module. In dynamic linking, the subroutine exists as a separate program and does not LINK to the main program. The static linking can be done by USING the NODYNAM link option and the dynamic linking can be done by using the DYNAM option.

3.

Differentiate between OS/VS COBOL and VS COBOL II.

Answer»
OS/VS COBOLVS COBOL II
Runs in 24-bit addressing mode.Runs either in 24-bit or 31-bit addressing modes.
Supports REPORT Writer.Does not SUPPORT Report Writer.
USAGE IS POINTER is not supported.USAGE IS POINTER is supported.
Reference modification is not supported here.Reference modification is supported here.
EVALUATE is not supported here.EVALUATE is supported here.
Scope terminators are not supported.Scope terminators are supported.
Follows ANSI 74 standards.ANSI 85 standards are FOLLOWED here.
Calls between programs are not supported under CICS (Customer Information Control SYSTEM).Calls between programs are supported under CICS.
4.

What is the importance of INITIALIZE verb?

Answer»

INITIALIZE verb is USED for initializing VALUES in data ITEMS to their default value. NUMERIC items will be set to 0, alphabetic and alphanumeric items will be set to spaces. Items like FILLERS, OCCURS DEPENDING ON are to be left untouched during the initialization.

5.

How is CALL command different from LINK?

Answer»

CALL command is an actual command that initiates an external program and returns. The LINK command is also SIMILAR to CALL but it does not belong to COBOL VERB vocabulary. The LINK command runs like a separate run unit whereas CALL is EXECUTED as a single run unit.

6.

How do we find current date from the system within a century?

Answer»

We can FIND it out by using the INTRINSIC function called FUNCTION CURRENT-DATE. We can also MAKE use of the DATE function for accepting the current date. It has to be NOTED that the current date cannot be accepted if we are using CICS COBOL programs.

7.

Why should we not define OCCURS clause at 01 level?

Answer»

01 LEVEL is the level of record. We can repeat the FIELDS WITHIN a record but we cannot repeat the record itself. The OCCURS clause INDICATES the REPETITION of the definition of data names. This is why we cannot use the OCCURS clause at the 01 level.

8.

Why is LINKAGE SECTION needed?

Answer»

It is used for PASSING data from one PROGRAM to ANOTHER. It can also be used for passing data from a PROCEDURE to another program. It maps data in the calling program’s working storage.

9.

What happens during INPUT PROCEDURE and OUTPUT PROCEDURE?

Answer»

In INPUT PROCEDURE, the input file will be opened, the records from the file are READ and can ALSO be edited. The records will then be released to sorting OPERATION and then the file will be CLOSED. Whereas in OUTPUT PROCEDURE, the output file will be opened, the records post sorting will be written in the output file and then the file will be closed.

10.

How is PERFORM … WITH TEST AFTER different from PERFORM … WITH TEST BEFORE?

Answer»

PERFORM ... WITH TEST BEFORE indicates that the condition must be TESTED at the BEGINNING of EVERY execution of the specified PERFORM range. WHEREAS TEST AFTER is used for TESTING the condition after every execution.

11.

How is SSRANGE different from NOSSRANGE?

Answer»

Both are options USED by the compiler for finding subscript outside of range.
SSRANGE is used for handling the overflow of an array systematically. It needs to be SPECIFIED explicitly which helps in finding exact subscript outside of range. Whereas the NOSSRANGE is used in cases of very sensitive applications that are driven by PERFORMANCE. It is the default option that gets applied and NEED not be specified explicitly and it does not support runtime errors whenever the index goes out of range.

12.

What is the importance of using REPLACING option in a COPY statement?

Answer»

REPLACING OPTION is USED for allowing the same COPY to be used multiple times by changing the replace value in the same code.
Syntax COPY <VariableName> REPLACING BY

13.

What is IS NUMERIC clause?

Answer»

This clause is USED for checking if an item is a numeric value or not. If it is numeric - positive or NEGATIVE, TRUE will be returned. For EXAMPLE:

CHECK-NUMBER SECTION. DISPLAY 'Check if input is numeric ' INPUT-NUM IF INPUT-NUM IS NUMERIC DISPLAY 'input is numeric' ELSE DISPLAY 'input is non numeric'
14.

How is the NEXT SENTENCE statement different from CONTINUE statement?

Answer»

The CONTINUE statement is like a null statement that indicates no operation and the control needs to be passed to the next executable instruction after explicit scope terminator. It can be USED anywhere in conditional STATEMENTS or imperative statements are used. Example syntax for CONTINUE in case of IF construct is:

IF condition-1 THEN {statement-1 ... | CONTINUE}[ELSE {statement-2 ... | CONTINUE}][END-IF]

The NEXT SENTENCE statement does the task of simply TRANSFERRING the control to an implicit CONTINUE statement that is present IMMEDIATELY after the next separator period. If the statement is specified along with the END-IF statement then the control passes to the statement after the closest following period. It is mainly used to TRANSFER control to the next sentence.

IF condition-1 THEN {statement-1 ... | NEXT SENTENCE}
15.

What are the available data types in the COBOL language?

Answer»

There are mainly three DATA types SUPPORTED by COBOL, they are:

  • Numeric data typeUSED for representing NUMERICAL VALUES between 0-9.
  • Alphabetic data type – Used for representing alphabetic values ranging from A-Z.
  • Alphanumeric data type – Used for representing both numeric and alphabetic types.
16.

What is COBOL?

Answer»

COBOL stands for Common Business Oriented Language and is one of the oldest high-level programming languages used for solving COMPLEX business problems in different domains like business verticals, finance, security and administrative purposes. Following are the features of this programming language:

  • Simplicity: It is an easy-to-learn language with a simple and wide VOCABULARY for syntax and has an uncluttered style of coding.
  • Business-oriented capabilities: COBOL has advanced capabilities for file HANDLING that let it operate on HUGE data and can be used for simple to complex processing operations thereby being it the most popular technology for handling business transactions.
  • Universality: COBOL is one of the oldest programming languages and has survived for more than 6 decades across growing business needs and has adapted across almost every platform, product and compiler.
  • Scalability: COBOL is highly scalable, reliable and is also PORTABLE across different platforms. They provide variables control structures that make it easy to read, debug and modify.