In COBOL, what are the typical sorting criteria you can specify while using the SORT verb?

  • One or more keys from the record
  • Only alphabetic fields
  • Only literal values
  • Only numeric fields
The SORT verb in COBOL allows you to specify one or more keys from the record as sorting criteria. These keys determine the order in which the records are sorted.

In a COBOL program, you are tasked with processing a file containing variable-length records representing student transcripts. You need to determine the total number of records and their average length. Which COBOL construct would you use to achieve this?

  • FILE STATUS
  • LINAGE IS 66
  • OCCURS
  • RECORDING MODE IS V
The OCCURS clause in COBOL is used to define a table, and it can be leveraged to process variable-length records. By using OCCURS, you can iterate through the records, calculate the total length, and determine the average length based on the number of records processed.

The _____ debugging technique in COBOL involves isolating parts of the code to identify the source of a problem.

  • Incremental
  • Isolation
  • Modular
  • Stepwise
The "Isolation" debugging technique in COBOL involves isolating specific parts of the code for focused analysis. This helps identify the source of a problem by narrowing down the scope of investigation, facilitating efficient debugging.

How can you ensure that a variable is accessible to multiple paragraphs within a procedure?

  • Declare the variable with a GLOBAL clause
  • Define the variable in the DATA DIVISION
  • Include the variable in the PROCEDURE DIVISION header
  • Use the GLOBAL paragraph to define the variable
To make a variable accessible to multiple paragraphs within a procedure in COBOL, you need to declare the variable in the DATA DIVISION. This ensures that the variable is known and can be referenced by any paragraph within the procedure.

In COBOL, when dealing with variable-length records, which data structure is used to determine the length of each record?

  • Data Division
  • File Section
  • Record Description Table (RDT)
  • Record Descriptor Entry (RDE)
In COBOL, the Record Descriptor Entry (RDE) is used to specify the length and structure of variable-length records. It contains information such as the starting position and length of each field within the record.

In Object-Oriented COBOL, _____ allows a class to provide different implementations of a method based on the specific object type.

  • Abstraction
  • Encapsulation
  • Inheritance
  • Polymorphism
Polymorphism in Object-Oriented COBOL allows a class to provide different implementations of a method based on the specific object type. It enhances flexibility by enabling a single method name to have different behaviors in different classes.

_____ is the file access mode used when you only need to read records from a file in COBOL.

  • EXTEND
  • I-O
  • INPUT
  • OUTPUT
"INPUT" is the file access mode used in COBOL when you only need to read records from a file. This mode allows the program to read data from the specified file but does not allow writing or updating records.

What is the purpose of a "core dump" in COBOL debugging?

  • A log of input/output operations
  • A report of compilation errors
  • A snapshot of the program's memory contents
  • A summary of executed COBOL statements
In COBOL debugging, a "core dump" refers to a snapshot of the program's memory contents at a specific point in time. It helps developers analyze the state of the program's variables and memory structures, aiding in identifying the cause of issues.

To access a specific element within a table, you typically use an _____ variable.

  • INDEX
  • OCCURS
  • RANGE
  • SIZE
To access a specific element within a table in COBOL, you typically use an INDEX variable. The INDEX variable represents the position of the element within the table and is used to navigate and retrieve data from the array.

In a large COBOL application, you have multiple programs that need to share a common data structure. How can subprograms help in managing this data sharing efficiently?

  • COPY statement
  • Global Data Section
  • Parameter Passing
  • Redefine Clause
Subprograms can efficiently manage data sharing by using Parameter Passing. By passing parameters, data can be exchanged between the main program and subprograms, ensuring modularity and reducing dependencies on global data.