COBOL and DB2 Mainframe Programming

Test your knowledge of COBOL programming fundamentals and DB2 database integration on mainframe systems, including syntax, file handling, program structure, and SQL operations.

20 Questions Published

Questions

Question 1 True/False

COBOL host structures can have maximum of three levels in a COBOL/DB2 program

  1. True
  2. False
Question 2 Multiple Choice (Single Answer)

Which assembler routine used to obtain a formatted form of the SQLCA and a text message based on the SQLCODE field of SQLCA

  1. SQLCA
  2. DCLGEN
  3. DSNTIAR
  4. SQLSTATE
Question 3 True/False

To allow DB2 to close a cursor after a commit or a rollback operation, we use the WITH HOLD option of the DECLARE CURSOR statement.

  1. True
  2. False
Question 4 Multiple Choice (Single Answer)

In the segemented table space each segment contain.

  1. Can contain only one table but rows from different tables are mixed
  2. Can contain only one table but rows from different tables are not mixed
  3. Can contain more than one table but rows from different tables are mixed
  4. None of these
Question 5 Multiple Choice (Single Answer)

Which DB2 Utility is used to declare Tables in cobol/DB2 programs

  1. DCLGEN
  2. SQLCA
  3. SQLSTATE
  4. SQLCODE
Question 6 True/False

The performance of static SQL is better than dynamic SQL, because for static SQL the binding is done only once and the program can be executed many times

  1. True
  2. False
Question 7 True/False

The SQL statement EXECUTE IMMEDIATE causes an SQL statement to prepare and execute, dynamically, at run time.

  1. True
  2. False
Question 8 Multiple Choice (Single Answer)

When using DISPLAY statement, on the system punch device, the last eight characters are used for

  1. Line Number
  2. PROGRAM-ID name
  3. User ID
  4. Nothing
Question 9 Multiple Choice (Single Answer)

ENTRY is

  1. Entry will enter the main program and execute it.
  2. Specifies the program entry.
  3. It establishes an alternate entry point into a COBOL called subprogram.
  4. ENTRY is not a COBOL keyword
Question 10 Multiple Choice (Single Answer)

What is EXIT PROGRAM?

  1. Invalid Syntax
  2. Specifies the end of a called program and returns control to the calling program.
  3. Specifies the end of a called program.
  4. Specifies the end of a calling program.
Question 11 Multiple Choice (Single Answer)

Why do ypu use INVOKE in COBOL?

  1. To creates object instances of a COBOL or Java class or invokes a method defined in a COBOL or Java class
  2. To creates object instances of a COBOL or ORACLE class or invokes a method defined in a COBOL or ORACLE class
  3. To creates object instances of a COBOL or UNIX class or invokes a method defined in a COBOL or UNIX class
  4. Invalid Syntax
Question 12 Multiple Choice (Single Answer)

Maximum length of program name (compact mode) that can be specified in PROGRAM-ID is

  1. 8
  2. 10
  3. 20
  4. 30
Question 13 Multiple Choice (Single Answer)

RECURSIVE in PROGRAM-ID will

  1. Loop the program
  2. What is RECURSIVE?
  3. Recursively reenters
  4. Recursively reenters only for CICS program
Question 14 Multiple Choice (Single Answer)

What are the valid level numbers other than 66, 77 & 88?

  1. 1 to 99
  2. 1 to 50
  3. 1 to 49
  4. 1 to infinite
Question 15 Multiple Choice (Single Answer)

What do ypu mean by BLOCK CONTAINS 0?

  1. No Blocks
  2. Block size is unlimited
  3. The block size is determined at run time from the DD parameters
  4. The block size is determined at compile time from the DD parameters
Question 16 Multiple Choice (Single Answer)

What must be the BLOCK CONTAINS when RECORDING MODE U?

  1. Zero
  2. Cant use it.
  3. 323327
  4. 332227
Question 17 Multiple Choice (Single Answer)

What is EXPLICIT SCOPE TERMINATOR?

  1. It marks the end of certain Procedure Division statements.
  2. It marks the end of certain looping condition statements.
  3. It marks the end of program.
  4. There is nothing like EXPLICIT SCOPE TERMINATOR in COBOL
Question 18 Multiple Choice (Single Answer)

How many divisions we should have in COBOL programs

  1. 2
  2. 3
  3. 4
  4. none of the above
Question 19 Multiple Choice (Single Answer)

What’s the PICTURE clause for Alphabetic identifiers

  1. PIC X ()
  2. PIC 9 ()
  3. PIC A ()
  4. PIC ()
Question 20 Multiple Choice (Single Answer)

What are the acceptable types of the COBOL identifiers

  1. Alphanumeric
  2. Numeric
  3. Alphabetic
  4. all the above