Getting Started with Mainframe COBOL

This course serves as an introduction to programming in COBOL, especially on the Mainframe, through use of a real-world example program.
Course info
Rating
(31)
Level
Beginner
Updated
Jan 12, 2017
Duration
2h 41m
Table of contents
Description
Course info
Rating
(31)
Level
Beginner
Updated
Jan 12, 2017
Duration
2h 41m
Description

COBOL seems to have more lives than a herd of cats. The death of COBOL has been touted for years - nay, decades. Yet, according to some estimates, there are well over 200 BILLION lines of COBOL code out there - and more code is being generated every day. In this course, Getting Started with Mainframe COBOL, you will learn many of the basics of the oft underestimated language that is COBOL by using it to solve a real-world business request. First, you'll learn all about the history of COBOL. Next, you'll explore the COBOL program structure. Finally, you'll wrap up this course by learning about data types and then trying your hand at writing a real-world COBOL program. By the end of this course, you'll understand the basics of COBOL, including being able to successfully write your own programs.

About the author
About the author

Tim has been programming professionally for over 20 years. He has written in Assembly for various CPUs, C/C++, COBOL, Ideal, RPGII, and many other languages, from PCs to Mainframes. Tim has taught night classes at Keene State College and currently teach Martial Arts.

Section Introduction Transcripts
Section Introduction Transcripts

Course Overview
Hi everyone, my name is Tim Slate, and welcome to my course, Getting Started with Mainframe COBOL. Let my 25 years of experience be your guide as you venture into the still-growing world of mainframe COBOL programming. There are an estimated 200 billion lines of COBOL code running systems across all four corners of the globe, though I'm confused as to how a globe has corners, but I digress. Further, an estimated 50% of current COBOL programmers are at or past retirement age, providing significant long-term employment opportunities for those entering the field. This course introduces you to mainframe COBOL programming. Some of the major topics that we will cover include the history of COBOL, COBOL program structure, data types typically not found in non-mainframe environments and oh yeah, writing a real-world COBOL program. By the end of this course, you'll understand the basics of COBOL including being able to successfully write your own programs. You'll also have an appreciation for why COBOL has endured for over 50 years and why it still has at least another 50 years of life ahead. Before beginning this course, you should be familiar with basic programming concepts including being comfortable with ideas like fields, variables, files, and bytes. I hope you'll join me on this journey to learn mainframe COBOL programming with the Getting Started with Mainframe COBOL Course at Pluralsight.

Understanding COBOL Source Code Structure
With our history lesson behind us, I welcome you to understanding COBOL source code structure. At the highest level, every COBOL program has four divisions. In this clip, we'll briefly describe each of these four divisions, which always occur in the same order in every program. The identification division, the environment division, the data division, and the procedure division. Now, this is simply a quick overview of the divisions. We'll deep dive into each of these in later clips. Let's start with the identification division. The identification division is always the first division in COBOL program. The only thing that can precede this is the compiler options, but we won't get into those here. The identification division includes, well, the identifying information for the program, such as the program's name, the person who wrote the program, creation date, and similar details. The second division is the environment division. There are two things that get defined here: One is the configuration attributes, such as indicating if the program is being run on a system other than its being compiled on, and other special setups. The other is the external aspects of the file to be used by the program, like what kind of file it is and the external name reference. The data division is the third division in COBOL. This is where we define fields coming in from files, for example the record layout, field use only by this program, like accumulators, flags, and counters, and fields that are owned by other programs, but we have access to, such as parameters patched by a calling program. The final division is the procedure division. All of your program commands like compute, if, and read go here.

Making COBOL Do Your Bidding
So far in this course we have had a history lesson, gone over file types and data types, and more. Now finally, we get to the meat of the COBOL programming. Well unless you're a vegetarian, in which case we now get to the soy of COBOL programming? Anyway, now we dive into the fourth and final division of COBOL. The division where we bend COBOL to our will, where we make COBOL do our bidding. This is the procedure division. In this clip we will discuss what is contained in the procedure division and how the procedure division is begun. The procedure division is where the code of your program actually resides. This is where you tell COBOL what you want to do. Open files, read and write records, compute fields, et cetera. As such, this division is almost always the largest division. The procedure division is begun with the procedure division statement. Shocking, isn't it? Unlike the other division statements, the procedure division statement has an optional parameter. For example, you may see a procedure division line that looks like this. This means that this is a subprogram which will be passed three parameters. Getting into the details of this is beyond the scope of this course. But I figured it was worth showing this in case you run into it.