
This lecture describes COBOL, where it is used, and why it is still a very good language to learn.
Learn what this course will cover and what it will not cover.
It is essential to set up your environment so you can start coding. See how to do this. DO NOT GO FURTHER UNTIL YOU GET THE SOFTWARE WORKING!
Writing code is only the first step. To get a program to run it must be compiled and then run. See how it is done in the OpenCOBOL IDE.
After completing this lecture you should have an overview of variables and their data types.
COBOL is a very 'structured' language. Learn the main divisions and sections necessary for even a basic COBOL program.
All programming languages have variables which are used to store values for use later in the program. See the basic types of variables in COBOL.
This is how to set up your DATA Division in an organized manner to make your program easier to maintain.
Comments are necessary in all programming languages. Basically they are text the compiler ignores but the programmer uses to document how things work in the program. They are a kind of pseudo-code.
How copylibs work in a COBOL program.
'Debug' is the term used for being able to step through a program line by line, look at variable values, and see where your program went wrong. Again, this is common to all languages and environments.
The first thing you want to do is be able to write output to the terminal. In COBOL that is done with a DISPLAY statement. See how it is used in a COBOL program.
More examples of the DISPLAY statement and how it is used.
The second thing you want to do after being able to write out is the ability to read in. In COBOL, that is done via the ACCEPT statement. This will show you examples of how the ACCEPT works.
As with all programming languages, if it is expecting a numeric but gets an alpha and tries to use it like a number, it blows up. Rather than blowing up, most other programming languages have a 'try-catch' statement to handle the error rather than blow up. In COBOL you use the redefines and numeric check to accomplish the same thing.
How the conditional, otherwise known as 'if/then', works in a COBOL program.
The concept of a 'nested' IF is common in all programming languages. Learn what nesting means, how it is applied, and when it is necessary.
How to use the EVALUATE statement in a COBOL program.
How a loop that executes an indefinite number of times works in COBOL.
Describes how a loop that executes an exact number of times, normally called a FOR loop in other programming languages, works in COBOL.
This is an example program showing how to do the FOR loop equivalent.
A program showing how tables are defined in a COBOL program, how they are like arrays, and how they are used.
An example of how a COBOL program does a linear search against a table.
A binary search is a special kind of search normally reserved for searching large tables. If this were a data structure you would probably have to create some algorithm to do it. In COBOL, the binary search is coded in one statement.
The idea of sections / paragraphs, somewhat equivalent to functions in other languages, and how they work in a COBOL program.
A COBOL program example using sections.
This section shows how to create a report in COBOL. It is more advanced than our previous programs with many sections, loops, an input and output file, and report statements. There are a LOT of COBOL reporting programs out there. If you can follow this you are doing well.
This is a continued explanation of our COBOL report.
The finale of the COBOL report program now looking at the output file and showing how the COBOL print lines and report lines match up.
This course teaches the basics of programming using the COBOL language. Introductory programming concepts can be shown in practically all programming languages but are rarely done in COBOL. Some people do not consider it a 'modern' language, however COBOL is still being used(I am still using it). The same things that are taught in Python or C in an introductory programming class exist in COBOL and I should know because I have been teaching introductory programming courses in multiple languages for almost twenty years. This class works through the normal progression of programming. First you have to set up the software. Then you write your first 'Hello World' program to show how to print output. After learning how to write out you have to learn how to read in data from the terminal. After being able to read and write, you get into more details and data types. Once you have a clear understanding of that, you go into the common programming structures: if/then, loops, and tables/arrays. Once you understand them, you have to start breaking up your program into sections/functions. This is probably the most important concept in all of beginning programming. COBOL does not have parameters and arguments like other programming languages but I show how COBOL does use the Linkage Sections to accomplish the same thing. The class will then show how COBOL is used on the mainframe, the most common home of COBOL coding. I also give an example of a COBOL report program, which is another very common use for a COBOL program. This will cover everything and introductory class plus some, plus you learn a language that is not commonly taught., Whether you have an interest in programming or just an interest in COBOL, I believe this will be a very informative class.