Quiz: Performance Tuning

Multiple Choice

1. In a typical COBOL batch program, what percentage of elapsed time is usually spent on I/O?

a) 10-20% b) 30-50% c) 50-70% d) 80-95%

2. Which data type provides the fastest arithmetic performance on IBM mainframes?

a) PIC 9(9)V99 (DISPLAY) b) PIC 9(9)V99 COMP-3 (packed decimal) c) PIC S9(9)V99 COMP (binary) d) PIC 9(9)V99 COMP-1 (floating point)

3. A sorted table has 10,000 entries. How many comparisons does SEARCH ALL require at most?

a) 5,000 b) 100 c) 14 d) 10

4. Changing the block size of a sequential file from 100 bytes (unblocked) to 32,000 bytes reduces I/O operations by approximately what factor?

a) 2x b) 10x c) 100x d) 320x

5. Which compiler option provides the most aggressive CPU optimization?

a) NOOPTIMIZE b) OPTIMIZE(STD) c) OPTIMIZE(FULL) d) NUMPROC(PFD)

6. What is the primary risk of using NOSSRANGE in production?

a) Slower compilation b) Larger object code c) Subscript out-of-range errors won't be detected, potentially causing storage overlays d) Incompatibility with CICS

7. Which SQL optimization technique reduces DB2 overhead when processing many rows?

a) Using SELECT * instead of named columns b) Multi-row FETCH c) Removing all indexes d) Using dynamic SQL instead of static SQL

8. In CICS, what is the purpose of the DATAONLY option on SEND MAP?

a) Sends only data fields, not the map format — reducing the amount of data transmitted b) Sends only the map format without data c) Sends data to a temporary storage queue d) Compresses the data before sending

9. What does a Strobe profile report tell you?

a) Which JCL statements are incorrect b) How much time the program spends in each paragraph c) Which compiler options were used d) How much disk space the program uses

10. In the VSAM buffer parameters AMP=('BUFND=20,BUFNI=10'), what does BUFNI control?

a) Number of data buffers b) Number of index buffers c) Number of input files d) Buffer initialization count

Short Answer

11. Explain why sorting a transaction file by master file key before processing can dramatically reduce I/O, even though it adds a sort step.

12. A program uses PIC 9(5)V99 (DISPLAY) for all monetary fields and performs 5 million arithmetic operations per run. What data type change would you recommend, and what approximate speedup would you expect?

13. Describe the three levels of the caching strategy used by MedClaim for fee schedule lookups. Why is a multi-level cache more effective than a single-level cache?

14. Your batch job runs in 3 hours. Profiling shows 2 hours 45 minutes are I/O and 15 minutes are CPU. A colleague proposes rewriting the arithmetic logic to save 5 minutes of CPU. Evaluate this proposal.

15. What is the difference between NUMPROC(PFD) and NUMPROC(NOPFD)? When is it safe to use PFD?

True/False

16. COMPUTE is generally slower than using individual ADD, SUBTRACT, MULTIPLY, and DIVIDE statements. (True/False)

17. Increasing VSAM buffer counts (BUFND/BUFNI) always improves performance. (True/False)

18. In a compound IF condition with AND, COBOL evaluates left-to-right and stops if the first condition is false. (True/False)

19. OPTIMIZE(FULL) makes programs easier to debug with interactive debuggers. (True/False)

20. A one-line JCL change (block size) can sometimes produce a larger performance improvement than weeks of code optimization. (True/False)


Answer key available in Appendix G.