Build your first COBOL application
Simple COBOL app reads input from three text files, merges their contents, and writes output containing one sorted list
This code pattern introduces you to a simple COBOL application that reads input from three text files, merges their contents, and writes an output containing one sorted list. We’ll spend some time introducing the contents of one of our JCL jobs as well as the COBOL source. Our goal is to help you get familiar with the basics of JCL and COBOL, but we’re not trying to make anyone an expert in a few short minutes.
There are two parts to this application: The first is the COBOL source code itself; the second is a set of three JCL jobs that need to be run to compile and build the application into a z/OS executable. Let’s look at each of these pieces individually.
The COBOL application stored in a file named
fxsort.cbl performs two main operations:
- It reads input from three files and merges their contents into one list.
- It then sorts that in-memory list and writes the result to an output file.
The supplied JCL can be used to compile, build, and execute the COBOL application.
- Compile your program.
- Link-edit your object.
- Run the program.
You can find the detailed steps for this pattern in the README file.