Chapter 42 Quiz: COBOL Career Guide and the Path Forward
Test your understanding of the COBOL profession, job market, career paths, industry practices, and the future of COBOL technology. Each question is followed by a hidden answer -- try to answer before revealing it.
Multiple Choice Questions
Question 1
Which industry sector employs the largest number of COBOL developers worldwide?
- a) Healthcare
- b) Banking and financial services
- c) Government (federal, state, and local)
- d) Retail and e-commerce
Show Answer
**b) Banking and financial services.** Banking and financial services is the largest employer of COBOL developers. This sector includes commercial banks, investment banks, insurance companies, credit unions, brokerage firms, and payment processors. An estimated 95% of ATM transactions, 80% of in-person financial transactions, and a majority of credit card processing systems run on COBOL. Government is the second-largest sector, followed by insurance (which overlaps with financial services).Question 2
A new COBOL developer is preparing for a technical interview. Which of the following is the MOST important area to study?
- a) Object-oriented COBOL features (classes, methods, interfaces)
- b) Practical file processing, DB2 SQL, JCL, and debugging techniques
- c) COBOL 2014 standard intrinsic functions
- d) XML GENERATE and JSON PARSE syntax
Show Answer
**b) Practical file processing, DB2 SQL, JCL, and debugging techniques.** COBOL technical interviews focus overwhelmingly on practical, production-relevant skills. Interviewers ask about file status codes, DB2 SQLCODE handling, JCL COND parameters, ABEND code interpretation, and debugging methodology. These are the skills that matter on day one of the job. Object-oriented COBOL, modern XML/JSON features, and the latest standard features are rarely tested in interviews because most production COBOL code uses COBOL-85 patterns. Knowing these modern features is a bonus, but practical fundamentals are what get you hired.Question 3
What is the primary reason organizations have difficulty replacing their COBOL systems?
- a) COBOL programmers refuse to document their code
- b) The business rules embedded in the code are complex, undocumented, and tested by decades of production use
- c) Modern programming languages cannot handle the transaction volumes
- d) Regulatory agencies require the use of COBOL for financial processing
Show Answer
**b) The business rules embedded in the code are complex, undocumented, and tested by decades of production use.** Large COBOL systems (often millions of lines of code) encode thousands of business rules that have been refined through decades of production use, regulatory changes, and edge case handling. These rules are often undocumented outside the code itself. Rewriting the system means re-discovering, re-implementing, and re-testing every one of these rules -- a process that frequently takes longer and costs more than originally estimated. The Commonwealth Bank of Australia's core banking replacement, for example, took 5 years and cost over $1 billion AUD. Many organizations have started and abandoned similar projects.Question 4
Which career path typically offers the highest compensation for a COBOL professional with 10+ years of experience?
- a) Staff COBOL application developer at a large bank
- b) Independent modernization consultant
- c) COBOL instructor at a community college
- d) Junior project manager overseeing COBOL maintenance
Show Answer
**b) Independent modernization consultant.** Independent consultants with deep COBOL expertise and modernization experience command the highest rates in the COBOL market. These professionals typically bill $150-$250+ per hour (or equivalent day rates) for engagements that combine COBOL knowledge with API integration, cloud migration, or system architecture skills. Staff developer roles at large banks offer excellent base salaries ($120,000-$180,000+ for senior developers in major financial centers) but typically do not match the earning potential of experienced independent consultants. However, consulting involves business risk, irregular income, and travel that salaried positions do not.Question 5
What does the term "API enablement" mean in the context of COBOL modernization?
- a) Rewriting COBOL programs in a language that supports REST APIs
- b) Exposing existing COBOL business logic through modern API interfaces without rewriting the COBOL code
- c) Adding API documentation to COBOL program headers
- d) Converting COBOL copybooks to JSON schema definitions
Show Answer
**b) Exposing existing COBOL business logic through modern API interfaces without rewriting the COBOL code.** API enablement is one of the most common and practical modernization approaches. The existing COBOL programs continue to run on the mainframe, but a thin integration layer (often using CICS web services, z/OS Connect, or IBM API Connect) makes the COBOL business logic accessible through REST/JSON APIs. This allows modern web applications, mobile apps, and cloud services to invoke COBOL processing without any changes to the COBOL code itself. It is lower risk, lower cost, and faster to implement than rewriting the COBOL programs.Question 6
A COBOL developer's resume lists "5 years of COBOL experience" but the hiring manager wants to understand the depth of that experience. Which of the following skill combinations most strongly indicates a well-rounded COBOL developer?
- a) COBOL, JCL, VSAM
- b) COBOL, DB2, CICS, JCL, VSAM, DFSORT
- c) COBOL, Python, JavaScript, AWS
- d) COBOL, REXX, ISPF panels, TSO CLISTs
Show Answer
**b) COBOL, DB2, CICS, JCL, VSAM, DFSORT.** This combination indicates a developer who has worked across the full mainframe application stack: COBOL for business logic, DB2 for relational data, CICS for online transactions, JCL for batch orchestration, VSAM for high-speed file access, and DFSORT for data manipulation. This is the core skill set that production mainframe shops require. Option (a) is too narrow (missing DB2 and CICS, which are essential for most enterprise applications). Option (c) suggests a modern developer who has added COBOL rather than a mainframe specialist. Option (d) is biased toward systems programming rather than application development.Question 7
What is the significance of the SHARE conference for COBOL professionals?
- a) It is the only venue where IBM announces new COBOL compiler releases
- b) It is a user group conference where mainframe professionals share technical knowledge, network, and influence IBM product direction
- c) It is a COBOL certification exam site
- d) It is exclusively for mainframe hardware engineers
Show Answer
**b) It is a user group conference where mainframe professionals share technical knowledge, network, and influence IBM product direction.** SHARE (founded in 1955) is one of the oldest technology user groups in the world. It brings together thousands of mainframe professionals for technical sessions, networking, and direct interaction with IBM product teams. For COBOL developers, SHARE provides access to the latest IBM Enterprise COBOL information, best practices from other organizations, and networking opportunities with potential employers and mentors. SHARE presentations are a common way for experienced developers to build professional visibility, and attending SHARE sessions is an efficient way for newer developers to accelerate their learning.Question 8
When transitioning from a modern development environment (e.g., Java/IntelliJ) to mainframe COBOL, which aspect of the platform causes the most initial difficulty for new developers?
- a) The COBOL language syntax itself
- b) The z/OS operating environment: TSO, ISPF, JCL, dataset naming conventions, and file allocation
- c) Understanding packed decimal arithmetic
- d) Learning the 72-column fixed format
Show Answer
**b) The z/OS operating environment: TSO, ISPF, JCL, dataset naming conventions, and file allocation.** Most developers who have experience with any procedural or structured programming language find COBOL's syntax manageable within a few weeks. The steeper learning curve is the z/OS platform itself: navigating TSO/ISPF (a green-screen interface that is fundamentally different from modern IDEs), understanding JCL (which has no direct equivalent in Unix/Linux/Windows), mastering dataset naming conventions and file allocation (which differ completely from filesystem paths), and learning the operational concepts of the mainframe (LPARs, SYSOUT, DD statements, catalogs, GDGs). This platform knowledge cannot be learned from the COBOL language reference alone -- it requires hands-on practice with the z/OS environment.Question 9
Which of the following statements best describes the current COBOL job market (mid-2020s)?
- a) COBOL jobs are declining rapidly and will be eliminated within 5 years
- b) COBOL jobs are stable with moderate growth in modernization-related roles, and a persistent gap between supply and demand
- c) COBOL jobs are growing faster than any other technology sector
- d) COBOL jobs exist only at government agencies and will not survive private-sector modernization
Show Answer
**b) COBOL jobs are stable with moderate growth in modernization-related roles, and a persistent gap between supply and demand.** The COBOL job market is characterized by steady demand driven by the massive installed base of COBOL systems in banking, insurance, government, and healthcare. Traditional maintenance and enhancement roles remain stable. Modernization-related roles (API enablement, cloud integration, migration analysis) are growing as organizations invest in connecting their COBOL backends to modern frontends. The most significant market dynamic is the supply gap: experienced COBOL developers are retiring faster than new ones are entering the field, which keeps compensation strong and creates opportunities for well-trained newcomers. The "COBOL is dead" narrative has been repeated for 30 years and has not materialized.Question 10
What is "knowledge concentration risk" in the context of COBOL maintenance teams?
- a) The risk that too many developers know the same systems, creating redundancy
- b) The risk that critical system knowledge is held by one or two individuals who may retire, resign, or become unavailable
- c) The risk that developers focus too much on COBOL and do not learn other technologies
- d) The risk that knowledge is spread too thinly across too many team members
Show Answer
**b) The risk that critical system knowledge is held by one or two individuals who may retire, resign, or become unavailable.** Knowledge concentration risk (also called "key person dependency" or "bus factor") is one of the most serious operational risks in organizations that rely on COBOL systems. When a system has been maintained by the same developer for 20 years, and that developer's understanding of the business rules, data relationships, and operational procedures exists only in their head, the organization faces catastrophic risk if that person becomes unavailable. Mitigations include documentation, cross-training, pair programming, and (most importantly) hiring and training additional COBOL developers -- which is one of the primary business justifications for investing in COBOL training programs.Question 11
Zowe is best described as:
- a) A COBOL compiler that runs on Linux
- b) An open-source framework that enables modern developer tools and workflows to interact with z/OS
- c) A CICS replacement for cloud-based COBOL execution
- d) A database system designed to replace DB2 on the mainframe
Show Answer
**b) An open-source framework that enables modern developer tools and workflows to interact with z/OS.** Zowe (hosted by the Open Mainframe Project under the Linux Foundation) provides a modern interface to z/OS through REST APIs, a CLI, and desktop/web applications. For COBOL developers, Zowe enables workflows like editing COBOL source in Visual Studio Code, submitting JCL jobs from the command line, browsing datasets through a web interface, and integrating mainframe operations into CI/CD pipelines. Zowe does not replace any z/OS component -- it provides a modern access layer on top of existing z/OS services, making the mainframe more accessible to developers who are accustomed to modern development tools.Question 12
A COBOL developer is asked to estimate the effort for adding a new report to a production system. The report requires reading 3 VSAM files, joining data from 2 DB2 tables, and producing a 132-column print file with 3 levels of control breaks. Approximately how long should an experienced developer estimate for this work?
- a) 2-4 hours
- b) 2-4 days
- c) 2-4 weeks
- d) 2-4 months
Show Answer
**c) 2-4 weeks.** This is a moderately complex report program that involves: understanding the data relationships across 5 data sources (which requires reading existing programs and documentation), writing the COBOL program with file I/O for 3 VSAM files, DB2 cursor processing for 2 tables, control break logic for 3 levels, report formatting, and page handling. Additionally, the developer must write JCL, create or modify copybooks, develop test data, test with realistic volumes, document the program, and move it through the change management process. An experienced developer would typically estimate 3-5 days for coding, 2-3 days for testing, and 2-3 days for documentation and deployment -- approximately 2 weeks under ideal conditions, with buffer for code review, JCL setup, and production verification.True/False Questions
Question 13
True or False: COBOL was the first programming language to be standardized by an international standards body (ANSI/ISO).
Show Answer
**False.** FORTRAN was standardized by ANSI before COBOL. FORTRAN received its first ANSI standard (FORTRAN 66) in 1966, while COBOL's first ANSI standard came in 1968 (COBOL-68). However, COBOL was one of the earliest standardized languages and has been continuously maintained through standards revisions: COBOL-74, COBOL-85, COBOL 2002, and COBOL 2014.Question 14
True or False: Most COBOL technical interviews focus heavily on data structure and algorithm questions similar to those asked at major technology companies.
Show Answer
**False.** COBOL technical interviews typically focus on practical, production-relevant knowledge: file processing patterns, DB2 SQL coding, JCL construction, debugging methodology, and business domain understanding. You are much more likely to be asked "What does file status 35 mean?" or "How do you handle a DB2 deadlock?" than to be asked to implement a binary search tree on a whiteboard. Some interviews include code walkthroughs where you read and explain existing COBOL code, which tests your ability to understand production programs -- a skill that matters more than algorithm design in most COBOL roles.Question 15
True or False: The COBOL language specification was originally created by a committee that included representation from both government and private industry, led by Grace Hopper.
Show Answer
**Partially True (best answered as True with clarification).** COBOL was created by the Conference on Data Systems Languages (CODASYL), a consortium that included representatives from government agencies (particularly the Department of Defense), computer manufacturers (IBM, Honeywell, RCA, Sperry Rand, others), and users. Grace Hopper was a key technical contributor and advocate whose earlier work on FLOW-MATIC heavily influenced COBOL's design. However, Hopper did not formally "lead" the CODASYL committee -- the Short Range Committee that produced the initial COBOL specification was chaired by Joseph Wegstein of the National Bureau of Standards. Hopper's contribution was essential, but the creation was genuinely a collaborative effort.Question 16
True or False: A COBOL developer who learns only the COBOL language and no platform technologies (DB2, CICS, JCL) is well-prepared for most mainframe development positions.
Show Answer
**False.** COBOL is necessary but not sufficient. Production mainframe development requires knowledge of the broader ecosystem: DB2 (or IMS) for database access, CICS for online transaction processing, JCL for batch job orchestration, VSAM for file management, DFSORT for data manipulation, and the z/OS operational environment (TSO/ISPF, SDSF, catalogs, security). A developer who knows only the COBOL language would struggle with the first production assignment, which almost certainly involves JCL modifications, DB2 queries, or file status handling. The platform skills are as important as the language skills.Question 17
True or False: Remote work opportunities for COBOL developers have increased significantly since 2020.
Show Answer
**True.** Before 2020, most mainframe development shops required on-site presence due to security policies and the perception that mainframe work could not be done remotely. The COVID-19 pandemic forced organizations to enable remote mainframe access, and many discovered that productivity remained stable or improved. As a result, a significant percentage of COBOL positions now offer remote or hybrid work arrangements. This has expanded the geographic reach of the COBOL job market: developers no longer need to live in major financial centers to work for banks, and organizations can recruit from a wider talent pool. However, some government agencies and high-security environments still require on-site work.Question 18
True or False: Automated COBOL-to-Java conversion tools produce code that is idiomatic, maintainable Java.
Show Answer
**False.** Automated conversion tools translate COBOL syntax to Java (or C#) syntax, but the resulting code preserves COBOL's structure and patterns. The Java output typically contains long procedural methods instead of object-oriented classes, COBOL-style variable naming, manual string manipulation instead of Java String methods, and packed decimal arithmetic emulation. Developers who inherit this converted code often find it harder to maintain than the original COBOL because it does not follow Java conventions and cannot be easily enhanced using standard Java patterns and libraries. The converted code is a mechanical translation, not a redesign.Question 19
True or False: The COBOL-85 standard is still the most commonly used version of COBOL in production systems.
Show Answer
**True.** Despite the existence of COBOL 2002 and COBOL 2014 standards, the vast majority of production COBOL code is written to the COBOL-85 standard (ANSI X3.23-1985). Most IBM Enterprise COBOL shops compile with options that support COBOL-85 syntax, and the coding patterns used in production -- structured programming with PERFORM, END-IF, END-EVALUATE, in-line PERFORM, reference modification -- are all COBOL-85 features. Modern features from COBOL 2002/2014 (object-oriented syntax, XML/JSON processing, dynamic tables) are used selectively in newer programs but have not replaced the COBOL-85 foundation in existing codebases.Question 20
True or False: Learning COBOL limits your career options to only mainframe-related positions.
Show Answer
**False.** While COBOL skills are most directly applicable to mainframe positions, the skills acquired through COBOL development are transferable to many technology roles. Understanding batch processing, file-based data pipelines, relational databases, transaction processing, and financial business logic are valuable in data engineering, systems integration, business analysis, and technical project management roles. Additionally, COBOL expertise combined with modern skills (cloud, APIs, DevOps) positions developers for modernization consulting, which is one of the highest-growth areas in enterprise technology. Many successful technology leaders began their careers in mainframe COBOL before transitioning to broader roles.Code Analysis Questions
Question 21
A candidate submits this code as part of a technical interview. What does it reveal about the candidate's experience level?
IDENTIFICATION DIVISION.
PROGRAM-ID. CUSTRPT.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT CUSTOMER-FILE ASSIGN TO CUSTFILE.
SELECT REPORT-FILE ASSIGN TO RPTFILE.
DATA DIVISION.
FILE SECTION.
FD CUSTOMER-FILE.
01 CUSTOMER-RECORD.
05 CUST-ID PIC X(10).
05 CUST-NAME PIC X(30).
05 CUST-BALANCE PIC 9(7)V99.
FD REPORT-FILE.
01 REPORT-RECORD PIC X(80).
WORKING-STORAGE SECTION.
01 EOF-FLAG PIC X VALUE 'N'.
PROCEDURE DIVISION.
MAIN-PARA.
OPEN INPUT CUSTOMER-FILE
OPEN OUTPUT REPORT-FILE
READ CUSTOMER-FILE
AT END MOVE 'Y' TO EOF-FLAG
END-READ
PERFORM UNTIL EOF-FLAG = 'Y'
MOVE CUSTOMER-RECORD TO REPORT-RECORD
WRITE REPORT-RECORD
READ CUSTOMER-FILE
AT END MOVE 'Y' TO EOF-FLAG
END-READ
END-PERFORM
CLOSE CUSTOMER-FILE REPORT-FILE
STOP RUN.
Show Answer
**This code reveals a beginner-level developer with academic exposure but no production experience. Indicators:** 1. **No FILE STATUS clause.** Production COBOL always checks file status after every I/O operation. The absence of FILE STATUS on the SELECT statements means the program cannot detect or handle I/O errors. 2. **No error handling.** If OPEN fails, the program continues to READ and will ABEND. No INVALID KEY, no file status checking, no error reporting. 3. **MOVE CUSTOMER-RECORD TO REPORT-RECORD instead of formatted output.** The program dumps the raw customer record directly to the report without formatting, column headers, page breaks, or totals. A production report program would have report line definitions with edited fields (PIC $Z,ZZZ,ZZ9.99 for balance, for example). 4. **No paragraph structure.** Everything is in MAIN-PARA. Production programs use a structured paragraph hierarchy (0000-MAIN, 1000-INITIALIZE, 2000-PROCESS, etc.). 5. **Simple flag instead of 88-level.** Using `EOF-FLAG = 'Y'` instead of defining an 88-level condition name shows unfamiliarity with COBOL conventions. 6. **No ORGANIZATION or ACCESS MODE on SELECT.** While defaults may work, production code explicitly states the file organization. 7. **Fixed-width FD with no RECORD CONTAINS or BLOCK CONTAINS.** Production code specifies record length and blocking. This code would work as a classroom exercise but would not pass code review in any production mainframe shop. An interviewer seeing this would assess the candidate as trainable but requiring significant mentoring.Question 22
Two candidates submit solutions to the same interview problem: "Write a paragraph that reads an account record by key and handles all possible outcomes." Compare the solutions.
Candidate A:
2000-READ-ACCOUNT.
READ ACCT-FILE INTO WS-ACCT-RECORD
KEY IS WS-ACCT-KEY
INVALID KEY
DISPLAY "RECORD NOT FOUND"
STOP RUN
END-READ.
Candidate B:
2000-READ-ACCOUNT.
MOVE WS-ACCT-KEY TO ACCT-KEY
READ ACCT-FILE INTO WS-ACCT-RECORD
INVALID KEY
CONTINUE
END-READ
EVALUATE WS-ACCT-FILE-STATUS
WHEN '00'
SET WS-ACCT-FOUND TO TRUE
WHEN '23'
SET WS-ACCT-NOT-FOUND TO TRUE
MOVE 'Account not found: '
TO WS-ERROR-MSG
STRING WS-ERROR-MSG DELIMITED SPACE
WS-ACCT-KEY DELIMITED SIZE
INTO WS-LOG-LINE
END-STRING
PERFORM 9100-WRITE-ERROR-LOG
WHEN OTHER
SET WS-ACCT-IO-ERROR TO TRUE
MOVE WS-ACCT-FILE-STATUS
TO WS-ERROR-STATUS
MOVE 'VSAM I/O error on account read'
TO WS-ERROR-MSG
PERFORM 9100-WRITE-ERROR-LOG
PERFORM 9200-SET-RETURN-CODE
END-EVALUATE
.
Show Answer
**Candidate B demonstrates significantly more production experience and would be the stronger hire.** **Candidate A's issues:** - Uses `DISPLAY` for error reporting (DISPLAY goes to SYSOUT, not to an error log that can be reviewed) - Uses `STOP RUN` on the first error, which is almost never appropriate in a production program -- it prevents any cleanup, file closing, or return code setting - Does not check FILE STATUS, relying only on INVALID KEY - Does not distinguish between "record not found" (a normal business condition) and "I/O error" (a system failure) - No error logging mechanism **Candidate B's strengths:** - Checks FILE STATUS after the READ, which catches all possible outcomes (not just INVALID KEY) - Uses 88-level conditions (WS-ACCT-FOUND, WS-ACCT-NOT-FOUND, WS-ACCT-IO-ERROR) to communicate the result to the calling paragraph - Distinguishes between file status '23' (record not found -- a business condition) and other statuses (I/O errors -- system conditions) - Logs errors to an error file with contextual information - Includes the key value in the error message for debugging - Uses a separate paragraph for return code management - Does not STOP RUN -- allows the calling paragraph to decide what to do - Uses structured paragraph naming conventions Candidate B's code shows awareness of production standards: error handling, logging, separation of concerns, and graceful error recovery.Question 23
A junior developer asks you to review their first production program. You notice the following WORKING-STORAGE pattern throughout:
01 WS-TEMP-FIELD-1 PIC X(50).
01 WS-TEMP-FIELD-2 PIC X(50).
01 WS-TEMP-FIELD-3 PIC 9(10).
01 WS-COUNTER PIC 9(05).
01 WS-FLAG PIC X(01).
01 WS-AMOUNT PIC 9(09)V99.
01 WS-RESULT PIC X(100).
What feedback would you give?
Show Answer
**This pattern reveals several issues that a mentor should address:** 1. **Non-descriptive variable names.** WS-TEMP-FIELD-1, WS-TEMP-FIELD-2, and WS-TEMP-FIELD-3 do not communicate their purpose. Production COBOL should use names like WS-FORMATTED-CUSTOMER-NAME, WS-SEARCH-KEY, or WS-ERROR-MESSAGE. Future developers (including the original author six months later) will not know what these fields are for. 2. **No 88-level conditions on WS-FLAG.** A bare PIC X(01) flag should have named conditions: 01 WS-ACCOUNT-FOUND-SW PIC X(01) VALUE 'N'.
88 WS-ACCOUNT-FOUND VALUE 'Y'.
88 WS-ACCOUNT-NOT-FOUND VALUE 'N'.
3. **Unsigned amount field.** WS-AMOUNT is PIC 9(09)V99 (unsigned). Financial amounts should almost always be signed (PIC S9(09)V99) and COMP-3 for efficiency and to handle credits/debits correctly.
4. **No grouping.** Related fields are not organized into group structures. Production code groups fields by purpose:
01 WS-PROCESSING-FIELDS.
05 WS-SEARCH-KEY PIC X(10).
05 WS-MATCH-COUNT PIC 9(05) VALUE ZERO.
05 WS-TOTAL-AMOUNT PIC S9(09)V99 COMP-3
VALUE ZERO.
5. **No VALUE clauses.** Fields that serve as counters or accumulators should be initialized with VALUE ZERO. Without explicit initialization, the developer must remember to INITIALIZE or MOVE ZERO before first use, which is a common source of bugs.
6. **Generous overallocation.** WS-RESULT PIC X(100) suggests the developer is not sure how large the field needs to be and is padding for safety. This is acceptable as a temporary measure but should be refined once the actual maximum length is known.
**Feedback approach:** Frame this as "how production shops do it" rather than "this is wrong." The code will work -- the issue is maintainability and professionalism. Show specific examples of the improved naming and explain why it matters.
Question 24
An experienced COBOL developer writes this in a modernization proposal. What strengths and weaknesses does it show?
*================================================================*
* ACCTAPI - Account Inquiry REST API Service *
* Wraps existing account inquiry logic as a JSON web service *
*================================================================*
IDENTIFICATION DIVISION.
PROGRAM-ID. ACCTAPI.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-JSON-RESPONSE PIC X(4096).
01 WS-JSON-LENGTH PIC S9(8) COMP.
01 WS-API-RESPONSE.
05 API-STATUS PIC X(10).
05 API-ACCT-NUMBER PIC X(10).
05 API-ACCT-TYPE PIC X(12).
05 API-BALANCE PIC S9(11)V99 COMP-3.
05 API-AVAILABLE PIC S9(11)V99 COMP-3.
05 API-CUST-NAME PIC X(50).
05 API-LAST-TXN-DATE PIC X(10).
LINKAGE SECTION.
01 DFHCOMMAREA.
05 COMM-REQUEST-TYPE PIC X(04).
05 COMM-ACCT-NUMBER PIC X(10).
PROCEDURE DIVISION.
0000-MAIN.
EVALUATE COMM-REQUEST-TYPE
WHEN 'INQR'
PERFORM 1000-ACCOUNT-INQUIRY
WHEN OTHER
PERFORM 9000-INVALID-REQUEST
END-EVALUATE
EXEC CICS RETURN END-EXEC
.
1000-ACCOUNT-INQUIRY.
MOVE COMM-ACCT-NUMBER TO WS-LOOKUP-KEY
CALL 'CAPINQRY' USING WS-LOOKUP-KEY
WS-API-RESPONSE
IF API-STATUS = 'SUCCESS'
JSON GENERATE WS-JSON-RESPONSE
FROM WS-API-RESPONSE
COUNT IN WS-JSON-LENGTH
END-JSON
EXEC CICS WEB SEND
FROM(WS-JSON-RESPONSE)
FROMLENGTH(WS-JSON-LENGTH)
MEDIATYPE('application/json')
STATUSCODE(200)
RESP(WS-RESP)
END-EXEC
ELSE
PERFORM 9100-SEND-ERROR-RESPONSE
END-IF
.
Show Answer
**Strengths:** 1. **Correct architectural approach.** The program wraps the existing inquiry logic (CAPINQRY) rather than reimplementing it. This is the right pattern for API enablement: the existing, tested business logic is reused. 2. **Clean separation of concerns.** The API layer handles HTTP and JSON; the business logic subprogram handles the inquiry. If the business logic changes, the API program does not need modification, and vice versa. 3. **Uses JSON GENERATE.** This is the correct COBOL approach for producing JSON output. The COBOL runtime handles the serialization. 4. **Error handling path exists.** The program checks API-STATUS and routes to an error handler for failed inquiries. **Weaknesses:** 1. **No RESP/RESP2 checking on CICS commands.** The EXEC CICS WEB SEND has RESP but no handling logic shown. If the SEND fails, the program returns without notification. 2. **No input validation.** COMM-ACCT-NUMBER is passed directly to the inquiry subprogram without validation. An API should validate that the account number is the correct format before invoking backend logic. 3. **COMP-3 fields in JSON output.** WS-API-RESPONSE contains COMP-3 fields (API-BALANCE, API-AVAILABLE). JSON GENERATE will serialize these as numeric values, but the specific formatting (decimal places, sign handling) depends on the COBOL runtime and may not produce the exact JSON format that API consumers expect. 4. **Hardcoded response buffer.** WS-JSON-RESPONSE at 4096 bytes may be insufficient if the response structure grows, and is wasteful if the typical response is much smaller. 5. **No HTTP status code handling.** The program sends 200 for success but the error path (9100-SEND-ERROR-RESPONSE) should send appropriate HTTP status codes (400 for bad request, 404 for not found, 500 for server error). 6. **No authentication/authorization.** A production API must verify that the caller is authorized to access account information. No CICS security checking is shown. **Overall assessment:** This is solid intermediate-level modernization code. The architecture is correct and the approach is practical. The weaknesses are in production hardening: error handling, input validation, and security -- all addressable without changing the fundamental design.Question 25
Review this excerpt from a COBOL developer's cover letter. What impression does it create?
"I am a seasoned mainframe developer with 30+ years of experience in COBOL, JCL, DB2, and CICS. I have maintained the same core banking system for my entire career and know every program in the system. I am not interested in learning new technologies like REST APIs or cloud computing because the mainframe handles everything we need. I am looking for a position where I can continue to maintain COBOL programs until I retire in 5 years."