Chapter 1 Quiz: The World of COBOL
Test your understanding of COBOL history, the mainframe ecosystem, program structure, and the language's continued relevance. This quiz contains 25 questions: 20 multiple choice and 5 short answer.
Multiple Choice Questions
Question 1. What does the acronym COBOL stand for?
- A) Computer-Oriented Business Operating Language
- B) Common Business-Oriented Language
- C) Compiled Business-Oriented Logic
- D) Common Batch-Oriented Language
Answer
**B) Common Business-Oriented Language.** Each word reflects a design goal: Common (portable across platforms), Business (designed for commercial data processing), Oriented (focused on practical problems), Language (a true programming language).Question 2. In what year was the first COBOL specification completed?
- A) 1955
- B) 1957
- C) 1959
- D) 1964
Answer
**C) 1959.** The CODASYL committee met at the Pentagon in May 1959, and the initial COBOL specification (COBOL-60) was completed within six months and released in April 1960. The committee itself was formed and began work in 1959.Question 3. Which organization played a key role in mandating COBOL adoption by requiring that all computers purchased by the federal government support the language?
- A) IBM
- B) The American National Standards Institute (ANSI)
- C) The U.S. Department of Defense
- D) The CODASYL committee
Answer
**C) The U.S. Department of Defense.** In 1960, the DoD mandated that any computer purchased by the federal government must be able to compile and run COBOL programs. This policy decision ensured that every major hardware manufacturer would support the language.Question 4. Grace Hopper is credited with all of the following EXCEPT:
- A) Developing the first compiler (A-0)
- B) Leading the development of FLOW-MATIC
- C) Chairing the CODASYL committee that created COBOL
- D) Championing the idea that programs should be readable by business professionals
Answer
**C) Chairing the CODASYL committee that created COBOL.** While Hopper served on the committee and was deeply influential, she did not chair it. She did develop the first compiler, lead FLOW-MATIC development, and champion English-like programming.Question 5. In fixed-format COBOL, what is the purpose of column 7?
- A) The first character of the program name
- B) The indicator area (comment, continuation, or debugging marker)
- C) The beginning of Area A
- D) Part of the sequence number area
Answer
**B) The indicator area.** Column 7 serves as the indicator area where special characters denote the line's purpose: `*` for a comment, `-` for a continuation line, `D` for a debugging line, and `/` for a comment with page eject.Question 6. Which of the following is NOT one of the four divisions of a COBOL program?
- A) IDENTIFICATION DIVISION
- B) CONFIGURATION DIVISION
- C) DATA DIVISION
- D) PROCEDURE DIVISION
Answer
**B) CONFIGURATION DIVISION.** CONFIGURATION SECTION is a section within the ENVIRONMENT DIVISION, not a separate division. The four divisions are: IDENTIFICATION, ENVIRONMENT, DATA, and PROCEDURE.Question 7. What is the only required paragraph in the IDENTIFICATION DIVISION?
- A) AUTHOR
- B) PROGRAM-ID
- C) DATE-WRITTEN
- D) INSTALLATION
Answer
**B) PROGRAM-ID.** PROGRAM-ID is the only required paragraph in the IDENTIFICATION DIVISION. It names the program and identifies it to the compiler and operating system. AUTHOR, DATE-WRITTEN, and INSTALLATION are optional documentation paragraphs.Question 8. The PICTURE clause PIC 9(5)V99 defines:
- A) A 5-character alphanumeric field with 2 trailing spaces
- B) A 7-digit numeric field with an implied decimal point after the fifth digit
- C) A 5-digit number followed by the letter V and two digits
- D) A variable-length numeric field up to 7 digits
Answer
**B) A 7-digit numeric field with an implied decimal point after the fifth digit.** The `9(5)` means five integer digits, `V` indicates an implied (not stored) decimal point, and `99` means two decimal digits. The field occupies 7 bytes of storage but represents numbers like 12345.67.Question 9. Which COBOL standard is widely regarded as the most important revision, introducing structured programming constructs?
- A) COBOL-68
- B) COBOL-74
- C) COBOL-85
- D) COBOL 2002
Answer
**C) COBOL-85.** This revision introduced scope terminators (END-IF, END-PERFORM, etc.), inline PERFORM, the EVALUATE statement, nested programs, and reference modification. These features transformed COBOL from a language that encouraged "spaghetti code" into one that supported clean, structured programming.Question 10. What does CICS stand for, and what is its primary function?
- A) Common Internet Communication System; web hosting
- B) Customer Information Control System; online transaction processing
- C) Central Integrated Computing Services; batch job management
- D) COBOL Interactive Compilation System; program development
Answer
**B) Customer Information Control System; online transaction processing.** CICS (pronounced "kicks") is IBM's online transaction processing system that handles real-time, interactive transactions such as ATM operations and bank teller inquiries.Question 11. According to the chapter, approximately what percentage of ATM transactions are processed by COBOL programs?
- A) 50%
- B) 75%
- C) 85%
- D) 95%
Answer
**D) 95%.** COBOL programs running on mainframes process approximately 95% of ATM transactions worldwide, making COBOL one of the most heavily used programming languages in financial transaction processing.Question 12. Which COBOL statement is used to terminate a program and return control to the operating system?
- A) EXIT PROGRAM
- B) END RUN
- C) STOP RUN
- D) TERMINATE PROGRAM
Answer
**C) STOP RUN.** The STOP RUN statement terminates program execution and returns control to the operating system. EXIT PROGRAM is used to return control to a calling program (not the OS). END RUN and TERMINATE PROGRAM are not valid COBOL statements.Question 13. In COBOL's fixed format, Area A (columns 8-11) is used for:
- A) Executable statements and clauses
- B) Comments and documentation
- C) Division headers, section headers, paragraph names, and level 01/77 numbers
- D) Sequence numbers
Answer
**C) Division headers, section headers, paragraph names, and level 01/77 numbers.** Area A is reserved for structural elements of the program. Executable statements and clauses go in Area B (columns 12-72). Sequence numbers go in columns 1-6.Question 14. What advantage does COBOL's decimal arithmetic have over floating-point arithmetic used in languages like C and Java?
- A) It is faster for all types of calculations
- B) It avoids rounding errors when handling currency values
- C) It supports larger numbers
- D) It requires less memory
Answer
**B) It avoids rounding errors when handling currency values.** COBOL uses packed decimal and display numeric formats that represent decimal values exactly. This is critical for financial calculations where floating-point rounding errors (e.g., $1,234.5600000001 instead of $1,234.56) are unacceptable.Question 15. Which of the following is a VSAM file organization type?
- A) KSDS (Key-Sequenced Data Set)
- B) RSDS (Random-Sequenced Data Set)
- C) HSDS (Hash-Sequenced Data Set)
- D) TSDS (Time-Sequenced Data Set)
Answer
**A) KSDS (Key-Sequenced Data Set).** The three VSAM file types are KSDS (Key-Sequenced Data Set, accessed by unique key), ESDS (Entry-Sequenced Data Set, records in insertion order), and RRDS (Relative Record Data Set, accessed by position).Question 16. Free-format COBOL was introduced in which standard?
- A) COBOL-85
- B) COBOL-74
- C) COBOL 2002
- D) COBOL 2014
Answer
**C) COBOL 2002.** Free-format source code, which removes the rigid column-based layout inherited from punch cards, was introduced in the COBOL 2002 standard. It allows code to start in any column, lines up to 255 characters, and uses `*>` for comments.Question 17. In a free-format COBOL program, how do you write a comment?
- A) Place an asterisk (*) in column 7
- B) Use the
*>marker at any position in the line - C) Use
//at the beginning of the line - D) Use
REMfollowed by the comment text
Answer
**B) Use the `*>` marker at any position in the line.** In free-format COBOL, comments begin with `*>` and can appear at any position. This replaces the fixed-format convention of placing `*` in column 7.Question 18. Which modernization approach involves keeping existing COBOL programs and exposing them through web-accessible interfaces?
- A) Rewriting in Java
- B) API enablement
- C) Database migration
- D) Cloud replatforming
Answer
**B) API enablement.** API enablement involves wrapping existing COBOL programs in RESTful APIs so that web applications, mobile apps, and microservices can call them. Tools like IBM z/OS Connect make this possible without modifying the COBOL code itself.Question 19. The GnuCOBOL compiler flag used to produce a standalone executable is:
- A)
-c - B)
-x - C)
-e - D)
-o
Answer
**B) `-x`.** The `-x` flag tells GnuCOBOL to compile the source code and produce a standalone executable program. The `-o` flag specifies the output file name (but does not by itself produce an executable). The `-c` flag would compile to an object file without linking.Question 20. Which of the following best describes COBOL's design goal regarding readability?
- A) COBOL was designed to be concise and minimize keystrokes
- B) COBOL was designed to be readable by business managers and auditors, not just programmers
- C) COBOL was designed primarily for mathematical notation
- D) COBOL was designed to be as similar to machine code as possible
Answer
**B) COBOL was designed to be readable by business managers and auditors, not just programmers.** The CODASYL committee deliberately chose English-like syntax so that non-programmers could read and understand COBOL programs. This was one of the language's central design goals.Short Answer Questions
Question 21. Explain the difference between the WORKING-STORAGE SECTION and the FILE SECTION of the DATA DIVISION. When would you use each?
Answer
The **FILE SECTION** defines the record layouts for files that the program reads from or writes to. Each file declared in the FILE-CONTROL paragraph has a corresponding FD (File Description) entry in the FILE SECTION that describes the structure of each record in the file. The **WORKING-STORAGE SECTION** defines variables used by the program during execution -- counters, accumulators, temporary values, constants, and other data items that are not directly tied to a file. These variables persist for the life of the program and can be initialized with VALUE clauses. You use the FILE SECTION when you need to define the structure of data as it appears in a file. You use WORKING-STORAGE when you need variables for calculations, intermediate results, display formatting, flags, or any data that the program creates and uses internally.Question 22. Describe two specific ways that the COVID-19 pandemic highlighted COBOL's continued importance in government and business systems.
Answer
First, when unemployment claims surged to unprecedented levels in 2020, state governments discovered that their claims processing systems -- written in COBOL decades earlier -- struggled with the dramatically increased volume. The problem was not the language itself but the difficulty of finding developers who could quickly modify and optimize these systems to handle the surge. Second, several states, including New Jersey, Connecticut, and Kansas, issued public calls for COBOL programmers, making international headlines. Governor Phil Murphy of New Jersey publicly requested volunteers with COBOL skills to help update the state's unemployment system. This brought widespread public attention to the fact that critical government infrastructure still depends on COBOL and exposed the severity of the COBOL skills shortage.Question 23. A COBOL program contains the following data definition. Explain what each component means:
01 WS-EMPLOYEE-SALARY PIC S9(7)V99 VALUE ZEROS.
Answer
- **01**: The level number, indicating this is a top-level (elementary or group) data item. Level 01 items are defined in Area A. - **WS-EMPLOYEE-SALARY**: The data name (variable name). The `WS-` prefix is a common convention indicating the variable belongs to WORKING-STORAGE. - **PIC S9(7)V99**: The PICTURE clause defining the data type and size: - **S**: The field is signed (can hold positive or negative values) - **9(7)**: Seven numeric digits for the integer portion (shorthand for 9999999) - **V**: An implied decimal point (not stored in memory, but the compiler knows where the decimal falls) - **99**: Two decimal digits - Total: a signed number with up to 7 integer digits and 2 decimal places (e.g., -1234567.89) - **VALUE ZEROS**: The initial value is zero (0000000.00). ZEROS is a COBOL figurative constant.Question 24. What is JCL and why is it important in the mainframe ecosystem? How does it differ from shell scripting in Unix/Linux?
Answer
JCL (Job Control Language) is the scripting language used to submit and manage batch jobs on the z/OS mainframe operating system. It tells the operating system what programs to execute, what datasets (files) to use as input and output, how to allocate disk space, how to handle errors, and how to sequence multiple processing steps. JCL differs from Unix/Linux shell scripting in several important ways: 1. **Declarative vs. imperative**: JCL is primarily declarative -- you describe what resources the job needs and which programs to run, rather than writing procedural logic. Shell scripts tend to be more imperative. 2. **Resource management**: JCL explicitly manages system resources like disk space allocation, device assignments, and output classes. Shell scripts generally rely on the OS to manage these automatically. 3. **Syntax**: JCL uses a rigid, column-sensitive syntax with specific delimiters (`//`) and keyword parameters. Shell scripting syntax is more free-form. 4. **Batch orientation**: JCL is designed for batch processing where jobs run without human interaction. Shell scripts can be interactive or batch. 5. **Enterprise features**: JCL integrates with the mainframe's workload management, scheduling, and security systems in ways that shell scripts do not.Question 25. The chapter describes COBOL's future as involving "hybrid architectures." Explain what a hybrid architecture is in this context and give a concrete example of how a bank might use one.
Answer
A hybrid architecture in this context is a technology strategy that combines mainframe COBOL systems with cloud-native and modern distributed technologies, allowing each platform to handle the workloads it does best. Rather than choosing "mainframe or cloud," organizations use both in an integrated fashion. A concrete example at a bank: The core account management and transaction processing systems continue to run on the mainframe in COBOL, where they benefit from decades of optimization, proven reliability, and regulatory compliance. These COBOL programs are exposed as REST APIs through a tool like IBM z/OS Connect. The bank's mobile banking application, built with a modern framework like React Native, communicates with these APIs to check balances, transfer funds, and process payments. Meanwhile, the bank's fraud detection system runs in the cloud, using machine learning models that consume real-time transaction data produced by the mainframe COBOL systems. New features like personal financial management dashboards are developed as cloud-native microservices but pull historical data from the mainframe. This architecture preserves the stability of the core COBOL systems while enabling rapid innovation at the customer-facing layer.Scoring Guide
| Score | Rating |
|---|---|
| 23-25 | Excellent -- you have a thorough understanding of Chapter 1 |
| 20-22 | Very Good -- strong grasp with minor gaps |
| 17-19 | Good -- solid understanding of core concepts |
| 14-16 | Satisfactory -- review the sections where you had difficulty |
| Below 14 | Needs Review -- re-read the chapter and try the exercises before retaking |