Show List

COBOL Interview Questions


  • What is COBOL?
    Answer: COBOL (Common Business Oriented Language) is a high-level programming language designed for business applications.
  • What are some of the key features of COBOL?
    Answer: Some of the key features of COBOL include its English-like syntax, support for large data sets, and its ability to handle both structured and unstructured data.
  • What is a data division in COBOL?
    Answer: The data division in COBOL defines the data used by a program, including variables, constants, and data structures.
  • What is a procedure division in COBOL?
    Answer: The procedure division in COBOL contains the program logic, including statements for input, processing, and output.
  • What are the different types of data in COBOL?
    Answer: COBOL supports several types of data, including alphanumeric, numeric, and binary data.
  • What are the different programming constructs in COBOL?
    Answer: The programming constructs in COBOL include conditionals, loops, subroutines, and other statements used to control the flow of execution.
  • What is a perform loop in COBOL?
    Answer: A perform loop is a type of loop in COBOL that is used to execute a block of code repeatedly.
  • What is the purpose of the EVALUATE statement in COBOL?
    Answer: The EVALUATE statement is used in COBOL to simplify complex decision-making logic by allowing the programmer to specify a set of conditions and corresponding actions.
  • What is the difference between a static and dynamic call in COBOL?
    Answer: In a static call, the subroutine to be called is known at compile time, while in a dynamic call, the subroutine is determined at run time.
  • What is the difference between a copy and an include statement in COBOL?
    Answer: A copy statement is used to include an entire copybook in a program, while an include statement is used to include a specific section of a copybook.
  • What is a level-number in COBOL?
    Answer: A level-number is a numeric value used to identify the level of a data item in the data division of a COBOL program.
  • What is the difference between a working storage section and a local storage section in COBOL?
    Answer: The working storage section is used to define data that is available to the entire program, while the local storage section is used to define data that is only available to a specific subroutine.
  • What is a report writer in COBOL?
    Answer: A report writer is a tool used to generate formatted reports in COBOL programs.
  • What is the purpose of the ACCEPT statement in COBOL?
    Answer: The ACCEPT statement is used in COBOL to accept input from the user or from a file.
  • What is the purpose of the DISPLAY statement in COBOL?
    Answer: The DISPLAY statement is used in COBOL to display output to the user or to a file.
  • What is a file section in COBOL?
    Answer: The file section in COBOL defines the files used by a program, including input and output files.
  • What is the difference between a sequential file and a random file in COBOL?
    Answer: A sequential file is a file that is read and written in sequential order, while a random file is a file that can be read and written in any order.
  • What is the difference between a record and a file in COBOL?
    Answer: A record is a unit of data in a file, while a file is a collection of records.
  • What is a paragraph in COBOL?
    Answer: A paragraph is a section of code in the procedure division that contains a specific set of instructions.
  • What is a perform until loop in COBOL?
    Answer: A perform until loop is a type of loop in COBOL that is used to execute a block of code repeatedly until a certain condition is met.
  • What is the purpose of the INITIALIZE statement in COBOL?
    Answer: The INITIALIZE statement is used in COBOL to set the initial value of one or more variables.
  • What is a level-88 in COBOL?
    Answer: A level-88 is a special type of level-number used to define condition-names in COBOL programs.
  • What is the difference between a call by reference and a call by value in COBOL?
    Answer: In a call by reference, the called subroutine can modify the value of the passed parameter, while in a call by value, the value of the passed parameter is not modified by the called subroutine.
  • What is the purpose of the INSPECT statement in COBOL?
    Answer: The INSPECT statement is used in COBOL to perform string manipulation, such as replacing characters or counting occurrences of specific characters.
  • What is a MOVE statement in COBOL?
    Answer: A MOVE statement is used in COBOL to move the value of one variable to another variable.
  • What is the difference between a redefine and a rename statement in COBOL?
    Answer: A redefine statement is used to define multiple data items that occupy the same memory location, while a rename statement is used to give a new name to an existing data item.
  • What is the difference between a fixed-length and variable-length record in COBOL?
    Answer: A fixed-length record has a fixed length that is defined in the program, while a variable-length record has a length that can vary depending on the data.
  • What is a subscript in COBOL?
    Answer: A subscript is an index used to reference a specific element of an array.
  • What is the difference between an array and a table in COBOL?
    Answer: An array is a collection of data items of the same type that can be accessed using an index or subscript, while a table is a collection of related data items of different types.
  • What is the purpose of the STRING statement in COBOL?
    Answer: The STRING statement is used in COBOL to concatenate two or more strings into a single string.
  • What is the purpose of the PERFORM VARYING statement in COBOL?
    Answer: The PERFORM VARYING statement is used in COBOL to perform a block of code repeatedly, with a varying control variable.
  • What is the purpose of the REDEFINES clause in COBOL?
    Answer: The REDEFINES clause is used in COBOL to define multiple data items that occupy the same memory location.
  • What is the difference between a sort and a merge in COBOL?
    Answer: A sort is used to sort data in ascending or descending order, while a merge is used to combine two or more sorted files into a single file.
  • What is the purpose of the COMPUTE statement in COBOL?
    Answer: The COMPUTE statement is used in COBOL to perform arithmetic operations on one or more variables.
  • What is a section in COBOL?
    Answer: A section is a subdivision of a program that contains related paragraphs.
  • What is a conditional statement in COBOL?
    Answer: A conditional statement in COBOL is used to test a condition and execute different sets of instructions based on the result.
  • What is the difference between a subscript and an index in COBOL?
    Answer: A subscript is used to access a specific element of an array, while an index is used to access a specific record in a file.
  • What is a perform until statement in COBOL?
    Answer: A perform until statement in COBOL is used to repeat a block of code until a certain condition is met.
  • What is the purpose of the OCCURS clause in COBOL?
    Answer: The OCCURS clause in COBOL is used to define an array.
  • What is a level-77 in COBOL?
    Answer: A level-77 in COBOL is used to define a single value that can be used as a condition.
  • What is a section header in COBOL?
    Answer: A section header in COBOL is a line of code that identifies the name of the section.
  • What is the purpose of the EVALUATE statement in COBOL?
    Answer: The EVALUATE statement in COBOL is used to test a condition and execute different sets of instructions based on the result.
  • What is the difference between a perform and a call statement in COBOL?
    Answer: A perform statement is used to execute a block of code within the same program, while a call statement is used to execute a subroutine in a different program.
  • What is a level-01 in COBOL?
    Answer: A level-01 in COBOL is used to define a record or group of data items.
  • What is a picture clause in COBOL?
    Answer: A picture clause in COBOL is used to define the data type and format of a data item.
  • What is the purpose of the DIVIDE statement in COBOL?
    Answer: The DIVIDE statement in COBOL is used to perform division on two or more variables.
  • What is the difference between a global and local variable in COBOL?
    Answer: A global variable can be accessed by any part of the program, while a local variable can only be accessed within the same paragraph or section.
  • What is a level-66 in COBOL?
    Answer: A level-66 in COBOL is used to define a condition-name.
  • What is a program-ID in COBOL?
    Answer: A program-ID in COBOL is a unique identifier used to name a COBOL program.
  • What is the purpose of the SEARCH statement in COBOL?
    Answer: The SEARCH statement in COBOL is used to search for a specific value in an array.
  • What is the difference between an inspect and a replace statement in COBOL?
    Answer: An inspect statement is used to count occurrences of specific characters in a string, while a replace statement is used to replace one character with another character in a string.
  • What is a linkage section in COBOL?
    Answer: A linkage section in COBOL is used to pass data between programs.
  • What is the difference between a display and a write statement in COBOL?
    Answer: A display statement is used to display data on the screen, while a write statement is used to write data to a file.
  • What is a perform until statement in COBOL?
    Answer: A perform until statement in COBOL is used to repeat a block of code until a certain condition is met.
  • What is the purpose of the PERFORM VARYING statement in COBOL?
    Answer: The PERFORM VARYING statement in COBOL is used to execute a block of code repeatedly, each time with a different value of a specified variable.
  • What is the purpose of the INITIALIZE statement in COBOL?
    Answer: The INITIALIZE statement in COBOL is used to set the initial value of one or more variables.
  • What is the difference between a binary and a packed decimal data type in COBOL?
    Answer: A binary data type in COBOL stores a number in binary form, while a packed decimal data type stores a number in binary-coded decimal format.
  • What is the purpose of the COMPUTE statement in COBOL?
    Answer: The COMPUTE statement in COBOL is used to perform arithmetic operations on two or more variables.
  • What is a level-88 in COBOL?
    Answer: A level-88 in COBOL is used to define a condition that can be tested.
  • What is the difference between a MOVE and a SET statement in COBOL?
    Answer: A MOVE statement is used to copy the contents of one variable to another variable, while a SET statement is used to set the value of a variable to a specified value.
  • What is the purpose of the END-IF statement in COBOL?
    Answer: The END-IF statement in COBOL is used to mark the end of a conditional statement.
  • What is a section in COBOL?
    Answer: A section in COBOL is a logical grouping of related code within a program.
  • What is the purpose of the UNSTRING statement in COBOL?
    Answer: The UNSTRING statement in COBOL is used to separate a string into its individual components.
  • What is a level-88 in COBOL?
    Answer: A level-88 in COBOL is used to define a condition that can be tested.
  • What is the purpose of the CLOSE statement in COBOL?
    Answer: The CLOSE statement in COBOL is used to close a file that has been opened for input/output.
  • What is the difference between a sequential and a random access file in COBOL?
    Answer: A sequential access file in COBOL can only be read from or written to sequentially, while a random access file can be accessed in any order.
  • What is a copybook in COBOL?
    Answer: A copybook in COBOL is a separate file that contains common code that can be included in multiple programs.
  • What is the purpose of the REDEFINES clause in COBOL?
    Answer: The REDEFINES clause in COBOL is used to define two or more variables that occupy the same memory location.
  • What is the difference between a static and dynamic call in COBOL?
    Answer: A static call in COBOL is resolved at compile time, while a dynamic call is resolved at runtime.
  • What is the purpose of the SET statement in COBOL?
    Answer: The SET statement in COBOL is used to set the value of a variable to a specified value.
  • What is the purpose of the READ statement in COBOL?
    Answer: The READ statement in COBOL is used to read a record from a file.
  • What is the difference between a level-01 and a level-77 in COBOL?
    Answer: A level-01 in COBOL is used to define a record or group of data items, while a level-77 is used to define a single value that can be used as a condition
  • What is the purpose of the PERFORM UNTIL statement in COBOL?
    Answer: The PERFORM UNTIL statement in COBOL is used to execute a block of code repeatedly until a specified condition is met.
  • What is the purpose of the EVALUATE statement in COBOL?
    Answer: The EVALUATE statement in COBOL is used to test a value against a series of conditions and execute the corresponding code for the first matching condition.
  • What is the difference between an index and a subscript in COBOL?
    Answer: An index in COBOL is a variable used to access the elements of an array, while a subscript is the position of an element within an array.
  • What is the purpose of the GOBACK statement in COBOL?
    Answer: The GOBACK statement in COBOL is used to return control to the calling program or system.
  • What is the difference between a call by reference and a call by value in COBOL?
    Answer: A call by reference in COBOL passes the address of a variable to a subroutine, while a call by value passes a copy of the variable's value.
  • What is the purpose of the ACCEPT statement in COBOL?
    Answer: The ACCEPT statement in COBOL is used to read input from the user.
  • What is the purpose of the REWRITE statement in COBOL?
    Answer: The REWRITE statement in COBOL is used to update a record that has been read from a file.
  • What is the difference between a COPY and an INCLUDE statement in COBOL?
    Answer: A COPY statement in COBOL copies the contents of a copybook into the program at compile time, while an INCLUDE statement includes the copybook at run time.
  • What is the purpose of the SET ENVIRONMENT statement in COBOL?
    Answer: The SET ENVIRONMENT statement in COBOL is used to set various system parameters, such as the date and time format.
  • What is the difference between a local and a global variable in COBOL?
    Answer: A local variable in COBOL is defined within a subroutine and is not accessible outside of it, while a global variable is defined outside of a subroutine and can be accessed from anywhere within the program.
  • What is the purpose of the PERFORM WITH TEST BEFORE statement in COBOL?
    Answer: The PERFORM WITH TEST BEFORE statement in COBOL is used to execute a block of code at least once and then repeat it until a specified condition is met.
  • What is the purpose of the STRING statement in COBOL?
    Answer: The STRING statement in COBOL is used to concatenate multiple strings into a single string.
  • What is the purpose of the GOTO statement in COBOL?
    Answer: The GOTO statement in COBOL is used to transfer control to a specified label within the program.
  • What is the purpose of the START statement in COBOL?
    Answer: The START statement in COBOL is used to position a file at a specified record.
  • What is the difference between a direct and an indirect file in COBOL?
    Answer: A direct file in COBOL can be accessed randomly, while an indirect file can only be accessed sequentially.
  • What is the purpose of the COPY REPLACING statement in COBOL?
    Answer: The COPY REPLACING statement in COBOL is used to replace specific strings within a copybook.
  • What is the purpose of the USAGE clause in COBOL?
    Answer: The USAGE clause in COBOL is used to specify the storage format for a data item, such as binary or packed decimal.
  • What is the purpose of the IDENTIFICATION DIVISION in COBOL?
    Answer: The IDENTIFICATION DIVISION in COBOL is used to provide information about the program, such as its name, author, and version.
  • What is the purpose of the PERFORM VARYING statement in COBOL?
    Answer: The PERFORM VARYING statement in COBOL is used to execute a block of code a specified number of times, with a variable changing its value during each iteration.
  • What is the purpose of the EXIT statement in COBOL?
    Answer: The EXIT statement in COBOL is used to terminate the execution of a program or subroutine.
  • What is the purpose of the INSPECT statement in COBOL?
    Answer: The INSPECT statement in COBOL is used to search and replace specific characters or strings within a data item.
  • What is the difference between an EXEC CICS LINK and an EXEC CICS XCTL command in COBOL?
    Answer: An EXEC CICS LINK command in COBOL calls a program and waits for a response, while an EXEC CICS XCTL command transfers control to a program and does not wait for a response.
  • What is the purpose of the CBL CHECK compiler option in COBOL?
    Answer: The CBL CHECK compiler option in COBOL checks for common coding errors and warns the programmer about potential issues.
  • What is the difference between a READ and a REWRITE operation in COBOL?
    Answer: A READ operation in COBOL reads a record from a file, while a REWRITE operation updates a record that has already been read.
  • What is the purpose of the UNSTRING statement in COBOL?
    Answer: The UNSTRING statement in COBOL is used to split a string into multiple substrings based on specified delimiters.
  • What is the difference between a SORT and a MERGE operation in COBOL?
    Answer: A SORT operation in COBOL sorts a file or table based on specified keys, while a MERGE operation combines two or more sorted files or tables into a single sorted file or table.
  • What is the purpose of the REDEFINES clause in COBOL?
    Answer: The REDEFINES clause in COBOL allows multiple data items to occupy the same storage location.
  • What is the purpose of the ACCEPT FROM TIME statement in COBOL?
    Answer: The ACCEPT FROM TIME statement in COBOL reads the current system time into a specified data item.
  • What is the purpose of the COMPUTE statement in COBOL?
    Answer: The COMPUTE statement in COBOL is used to perform arithmetic operations on one or more data items and store the result in another data item.
  • What is the purpose of the CALL statement in COBOL?
    Answer: The CALL statement in COBOL is used to call a subroutine from within a program.
  • What is the purpose of the END-IF statement in COBOL?
    Answer: The END-IF statement in COBOL is used to indicate the end of a conditional block of code.
  • What is the difference between an unconditional and a conditional GO TO statement in COBOL?
    Answer: An unconditional GO TO statement in COBOL transfers control to a specified label unconditionally, while a conditional GO TO statement transfers control based on a specified condition.
  • What is the purpose of the PERFORM THRU statement in COBOL?
    Answer: The PERFORM THRU statement in COBOL is used to execute a block of code until a specified label is encountered.
  • What is the difference between a binary and a packed decimal data type in COBOL?
    Answer: A binary data type in COBOL is used to store integer values in binary format, while a packed decimal data type is used to store decimal values in a compact binary format.
  • What is the purpose of the INITIALIZE statement in COBOL?
    Answer: The INITIALIZE statement in COBOL is used to set the value of one or more data items to their initial value.
  • What is the difference between a static and a dynamic call in COBOL?
    Answer: A static call in COBOL is resolved at compile time, while a dynamic call is resolved at runtime.
  • What is the purpose of the SET statement in COBOL?
    Answer: The SET statement in COBOL is used to set the value of a data item to a specified value.
  • What is the purpose of the USAGE IS POINTER clause in COBOL?
    Answer: The USAGE IS POINTER clause in COBOL is used to define a data item as a pointer to a memory address.
  • What is the difference between an external and a global data item in COBOL?
    Answer: An external data item in COBOL can be accessed by other programs, while a global data item can be accessed by other parts of the same program.
  • What is the purpose of the ACCEPT statement in COBOL?
    Answer: The ACCEPT statement in COBOL is used to read input from the user and store it in a specified data item.
  • What is the purpose of the REWRITE FROM statement in COBOL?
    Answer: The REWRITE FROM statement in COBOL updates a record in a file with the contents of a specified data item.
  • What is the purpose of the EVALUATE statement in COBOL?
    Answer: The EVALUATE statement in COBOL is used to perform multiple comparisons on a single data item and execute different blocks of code based on the results.
  • What is the difference between a sequential and a relative file in COBOL?
    Answer: A sequential file in COBOL is accessed sequentially, while a relative file is accessed based on a specified record number.
  • What is the purpose of the STRING statement in COBOL?
    Answer: The STRING statement in COBOL is used to concatenate multiple strings into a single string.
  • What is the purpose of the USING clause in COBOL?
    Answer: The USING clause in COBOL is used to pass parameters to a subroutine.
  • What is the difference between a MOVE and a SET statement in COBOL?
    Answer: A MOVE statement in COBOL copies the contents of one data item to another, while a SET statement sets the value of a data item to a specified value.
  • What is the purpose of the REDEFINES clause in COBOL?
    Answer: The REDEFINES clause in COBOL allows multiple data items to occupy the same storage location.
  • What is the difference between a PIC 9(4) and PIC 9(4) COMP-3 data type in COBOL?
    Answer: A PIC 9(4) data type in COBOL is stored as four bytes, while a PIC 9(4) COMP-3 data type is stored in a packed decimal format that takes up only two bytes.
  • What is the purpose of the EXIT PROGRAM statement in COBOL?
    Answer: The EXIT PROGRAM statement in COBOL is used to terminate a program and return control to the operating system.
  • What is the difference between a COBOL copybook and a subroutine?
    Answer: A COBOL copybook is a separate file that contains common code that can be included in multiple programs, while a subroutine is a block of code within a program that can be called from other parts of the same program.
  • What is the purpose of the MERGE statement in COBOL?
    Answer: The MERGE statement in COBOL is used to merge two or more sorted files into a single sorted file.
  • What is the difference between a STOP RUN statement and a GOBACK statement in COBOL?
    Answer: A STOP RUN statement in COBOL terminates the program, while a GOBACK statement returns control to the calling program.
  • What is the purpose of the FILE STATUS clause in COBOL?
    Answer: The FILE STATUS clause in COBOL provides information about the status of a file operation.
  • What is the purpose of the COMPUTE statement in COBOL?
    Answer: The COMPUTE statement in COBOL is used to perform arithmetic operations on one or more data items and store the result in another data item.
  • What is the difference between a copybook and an include statement in COBOL?
    Answer: A copybook is a separate file that is included in a program using the COPY statement, while an include statement includes code from a specified file directly in the program.
  • What is the purpose of the SEARCH statement in COBOL?
    Answer: The SEARCH statement in COBOL is used to search a table of values for a specified value and return the corresponding index.
  • What is the difference between a PERFORM VARYING and a PERFORM UNTIL statement in COBOL?
    Answer: A PERFORM VARYING statement in COBOL executes a block of code a specified number of times, while a PERFORM UNTIL statement executes a block of code until a specified condition is met.
  • What is the purpose of the ALTER statement in COBOL?
    Answer: The ALTER statement in COBOL is used to dynamically modify the attributes of a data item, such as its length or picture clause.
  • What is the purpose of the COPY statement in COBOL?
    Answer: The COPY statement in COBOL is used to include code from a separate copybook file in a program.
  • What is the difference between a READ and a READ NEXT statement in COBOL?
    Answer: A READ statement in COBOL reads a specific record from a file, while a READ NEXT statement reads the next sequential record in the file.
  • What is the purpose of the GO TO statement in COBOL?
    Answer: The GO TO statement in COBOL is used to transfer control to a specified label within the program.
  • What is the purpose of the OCCURS clause in COBOL?
    Answer: The OCCURS clause in COBOL is used to define an array data type.
  • What is the difference between an alphanumeric and a numeric edited data type in COBOL?
    Answer: An alphanumeric edited data type in COBOL allows for the inclusion of non-numeric characters in the data, while a numeric edited data type is limited to numeric characters.
  • What is a leveled set in COBOL?
    Answer: A leveled set in COBOL is a group of data items that are arranged in a hierarchical manner based on their level numbers.
  • What is the purpose of the INSPECT statement in COBOL?
    Answer: The INSPECT statement in COBOL is used to search for and replace characters within a data item.
  • What is a data division in COBOL?
    Answer: The data division in COBOL is where the data items used in the program are defined.
  • What is the purpose of the EVALUATE statement in COBOL?
    Answer: The EVALUATE statement in COBOL is used to evaluate multiple conditions and execute the appropriate block of code based on the result.
  • What is a report writer in COBOL?
    Answer: A report writer in COBOL is a tool used to generate formatted reports from data.
  • What is the purpose of the SET statement in COBOL?
    Answer: The SET statement in COBOL is used to assign a value to a data item.
  • What is a literal in COBOL?
    Answer: A literal in COBOL is a value that is explicitly defined within the program code.
  • What is the purpose of the OPEN statement in COBOL?
    Answer: The OPEN statement in COBOL is used to open a file for input, output, or both.
  • What is a level 88 condition in COBOL?
    Answer: A level 88 condition in COBOL is a Boolean condition that is used to test for a specific value or range of values within a data item.
  • What is the purpose of the EXHIBIT statement in COBOL?
    Answer: The EXHIBIT statement in COBOL is used to display a value on the screen or in a file.
  • What is a subroutine in COBOL?
    Answer: A subroutine in COBOL is a block of code within a program that can be called from other parts of the same program.
  • What is the purpose of the EXIT statement in COBOL?
    Answer: The EXIT statement in COBOL is used to exit a loop or block of code.
  • What is a sort file in COBOL?
    Answer: A sort file in COBOL is a temporary file used to sort data before it is processed.
  • What is the purpose of the STRING statement in COBOL?
    Answer: The STRING statement in COBOL is used to concatenate multiple strings into a single string.
  • What is a copybook in COBOL?
    Answer: A copybook in COBOL is a separate file that contains common code that can be included in multiple programs.
  • What is the purpose of the SET ADDRESS OF statement in COBOL?
    Answer: The SET ADDRESS OF statement in COBOL is used to assign a memory address to a pointer data type.
  • What is a pointer data type in COBOL?
    Answer: A pointer data type in COBOL is a data item that contains the address of another data item in memory.
  • What is the purpose of the CLOSE statement in COBOL?
    Answer: The CLOSE statement in COBOL is used to close a file after it has been processed.
  • What is a conditional statement in COBOL?
    Answer: A conditional statement in COBOL is used to test for a specific condition and execute the appropriate block of code based on the result.

    Leave a Comment


  • captcha text