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.
Questions
COBOL host structures can have maximum of three levels in a COBOL/DB2 program
- True
- False
Which assembler routine used to obtain a formatted form of the SQLCA and a text message based on the SQLCODE field of SQLCA
- SQLCA
- DCLGEN
- DSNTIAR
- SQLSTATE
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.
- True
- False
In the segemented table space each segment contain.
- Can contain only one table but rows from different tables are mixed
- Can contain only one table but rows from different tables are not mixed
- Can contain more than one table but rows from different tables are mixed
- None of these
Which DB2 Utility is used to declare Tables in cobol/DB2 programs
- DCLGEN
- SQLCA
- SQLSTATE
- SQLCODE
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
- True
- False
The SQL statement EXECUTE IMMEDIATE causes an SQL statement to prepare and execute, dynamically, at run time.
- True
- False
When using DISPLAY statement, on the system punch device, the last eight characters are used for
- Line Number
- PROGRAM-ID name
- User ID
- Nothing
ENTRY is
- Entry will enter the main program and execute it.
- Specifies the program entry.
- It establishes an alternate entry point into a COBOL called subprogram.
- ENTRY is not a COBOL keyword
What is EXIT PROGRAM?
- Invalid Syntax
- Specifies the end of a called program and returns control to the calling program.
- Specifies the end of a called program.
- Specifies the end of a calling program.
Why do ypu use INVOKE in COBOL?
- To creates object instances of a COBOL or Java class or invokes a method defined in a COBOL or Java class
- To creates object instances of a COBOL or ORACLE class or invokes a method defined in a COBOL or ORACLE class
- To creates object instances of a COBOL or UNIX class or invokes a method defined in a COBOL or UNIX class
- Invalid Syntax
Maximum length of program name (compact mode) that can be specified in PROGRAM-ID is
- 8
- 10
- 20
- 30
RECURSIVE in PROGRAM-ID will
- Loop the program
- What is RECURSIVE?
- Recursively reenters
- Recursively reenters only for CICS program
What are the valid level numbers other than 66, 77 & 88?
- 1 to 99
- 1 to 50
- 1 to 49
- 1 to infinite
What do ypu mean by BLOCK CONTAINS 0?
- No Blocks
- Block size is unlimited
- The block size is determined at run time from the DD parameters
- The block size is determined at compile time from the DD parameters
What must be the BLOCK CONTAINS when RECORDING MODE U?
- Zero
- Cant use it.
- 323327
- 332227
What is EXPLICIT SCOPE TERMINATOR?
- It marks the end of certain Procedure Division statements.
- It marks the end of certain looping condition statements.
- It marks the end of program.
- There is nothing like EXPLICIT SCOPE TERMINATOR in COBOL
How many divisions we should have in COBOL programs
- 2
- 3
- 4
- none of the above
What’s the PICTURE clause for Alphabetic identifiers
- PIC X ()
- PIC 9 ()
- PIC A ()
- PIC ()
What are the acceptable types of the COBOL identifiers
- Alphanumeric
- Numeric
- Alphabetic
- all the above