Common Business-Oriented Language
COBOL, Common Business-Oriented Language, manages some of the most critical data and business logic in the world's economy. Many reasons exist for why COBOL is a computer language with incredible longevity.
COBOL programming language benefits from over 50 years of advancements, such as, COBOL compiler optimization, and COBOL runtime performance.
The core business logic of many large enterprises has decades of business process improvements embedded in COBOL programs.
The point is - whatever you read or hear about COBOL, be very skeptical. The opportunity to work directly with someone involved in writing or maintaining critical business logic using COBOL is an opportunity to learn about the operation of the core business. Business managers, business analysts, and decision makers come and go. The sum of all good business decisions can frequently be found in COBOL programs. The answer to "How does this business actually work?" can be found in COBOL programs.
COBOL is incredibly easy to learn and understand. Auditors are not programmers. However, auditors are responsible for insuring the business financial statements are presented fairly. COBOL processing frequently results in business ledger updates and subsequent financial statements requiring code review by auditors.
A comment recently made in a well known business journal by someone with a suspect agenda was quoted as saying, "COBOL is a computing language used in business and finance. It was first designed in 1959 and is pretty old and slow." A highly experienced business technology person knows the only true part of that last sentence was that COBOL was first designed in 1959.
It's no secret many banks have millions of lines of COBOL on mainframes. COBOL is at the core of how many banks handle the daily money transactions totally transparent to the smart phones involved with initiating those banking transactions.
That is real world!
COBOL that runs in the z/OS Environment is called Enterprise COBOL.
A Comment from Peabody
COBOL is an attention getter on resumes. Hiring authorities and hiring influencers in large organizations running mission critical applications written in COBOL are more likely to spend more time reading a resume after spotting COBOL.
You will learn to recognize COBOL source code
You can complete this challenge without any experience with COBOL.
COBOL source code is provided. The COBOL source code is compiled into an executable module, then executed. The COBOL program reads the BBRI client data set name used in the previous challenge and prints several of the fields from each record.
The compile fails. The compile error is easy to recognize from a review of the COBOL compile output. A successful compile as a result of a modification made to the COBOL source is the first step to completing the challenge.
Following successful compile, program execution fails. The program execution failure is the result of COBOL internal name failing to match the JCL DDNAME. Review of the program execution error messages provide information needed to correct the JCL resuling in successful program execution to complete the challenge.
Review COBOL source code
- Edit z#####.source partitioned data set
- Select new empty member name cbl0001, s cbl0001
- Copy 'zos.mtm2018.public.source(cbl0001)' into cbl0001
- Observe the following:
1 - Identification
2 - Environment
3 - Data
4 - Procedure
> The first 3 Divisions declare fields used by the program execution logic in the Procedure Division
> COBOL verbs are English like
> Asterisk in column 7 results in the line treated as a comment
> Procedure Division lines 74 and 75 are comments, therefore not executed
>> The next challenge will execute these statements
>> Leave lines 74 and 75 as comment statements for now
- F3 to save and exit
You will edit the cobol source again to fix an error found during source code compile
Review JCL used to compile COBOL source and execute COBOL program
- Edit z#####.jcl partitioned data set and select, s, member name cbl0001j
- Observe the following:
IGYWCL is a system JCL procedure used to Compile COBOL source code
//COBOL.SYSIN references the COBOL source code input that you reviewed
//LKED.SYSLMOD references the executable program created from the compile
//STEP2 EXEC PGM=CBL0001 is program execution step
You will edit the JCL again to fix an error found during program execution
- submit ; =sd ; st jumping to SDSF status panel
Review CBL0001J JCL job used to compile COBOL source and execute the COBOL program
You should be in the SDSF status panel
Review the JCL job CBL0001J output
- SYSPRINT DDNAME in CBL0001J output has the COBOL compile messages
- IGYPS2072-S is a severe COBOL syntax error
- IGYPS2072-S text explains what needs to be fixed in the COBOL source code
Edit COBOL source, fix error, submit and review output
- Edit z#####.source partitioned data set member name cbl0001
- Modify COBOL source correcting the code syntax found in error during compile
- F3 to save and exit
- Submit JCL to compile and execute modified COBOL source code, then review the output
tso submit jcl(cbl0001j) ; =sd ; st jumping to SDSF status panel
If the compile was successful, then the output shows the program execution failed.
CBL0001J DDNAME SYSOUT for StepName STEP2 tells the story for the execution failure.
If the compile was unsuccessful, then review compile output for the error, locate and fix the error.
Identify and fix JCL that caused COBOL program execution to fail
Once the COBOL compile step is successful, then the COBOL execution step fails.
- CBL0001J SYSOUT DDNAME output contains the execution error failure message
COBOL for Beginners (above) has relevant information about the COBOL JCL relationship
- You will eventually realize that only 1 fix is necessary
The fix can be applied to either the JCL or the COBOL source code
Apply the fix to the JCL
Edit JCL, fix JCL execution error, submit and review output
- Edit z#####.jcl(cbl0001j)
- Modify JCL enabling COBOL program to successfully execute
- Submit modified JCL to compile and execute the COBOL source code, then review the output
submit ; =sd ; st jumping to SDSF status panel
If the COBOL program execution was successful, then
Use SDSF XDC command to write CBL0001J PRTLINE DDNAME output to P3.OUTPUT member #04
Writing PRTLINE output to P3.OUTPUT(#04) is required to get credit
If the COBOL program execution was unsuccessful, then review output for the error, locate and fix the error.
Z#####.P3.OUTPUT(#04) should contain CBL0001J PRTLINE DDNAME output.