This course introduces you COBOL programming.
The course first describes the basic structure of a COBOL program, using a complete program as an example. It then describes the rules for naming various types of COBOL objects and how to describe external files and internal data items. Next, the course covers the coding of common imperative statements and the basic control structures. By the end of this course, you will be able to code a complete COBOL program to read an input file, reformat records, and create an output file.
Approximate Study Time: 8 hours
After completing this course, you should be able to:
- Code the four divisions of a COBOL program
- Find and correct simple syntax errors in a sample COBOL program listing
- Code valid COBOL names for programs, files, paragraphs, and data items
- Code the SELECT and FD statements to describe a file
- Code the COBOL record description when given the record layout of a file
- Code the COBOL data descriptions when required variable and constant data items are described
- Code the COBOL statements to define, set, and test a program flag, given a description of program requirements
- Code simple ADD, SUBTRACT, and MOVE statements when given a description of the desired result
- Code simple OPEN, READ, WRITE, and CLOSE statements when given a description of the desired result
- Code an in-line PERFORM statement to delineate a block of COBOL code
- Code an out-of-line PERFORM statement to execute a precoded paragraph
- Code an IF statement to implement a simple selection structure
- Code a PERFORM statement to implement an iteration, testing the controlling condition either before or after each iteration
- Predict the results of move and comparison operations when the source and target fields are of the same or different lengths
- Code the corresponding data descriptions when given a description of required constant data items
- Code INITIALIZE and MOVE statements using literals and/or figurative constants
- Identify coding techniques that can improve the performance of a COBOL program
- Write COBOL statements using the DISPLAY or WRITE verbs to report on program execution or unexpected situations
- Write COBOL statements using the ACCEPT verb to obtain data from the TIME, DAY, DAY-OF-WEEK, and/or DATE special registers
- Define a date, time, or timestamp data item
- Predict the result of move and comparision operations involving dates, times, and timestamp data items
- Code a MOVE CORRESPONDING statement, to move corresponding fields of one group item to another, when given the descriptions of two group items containing matching subordinate items
- Code a COPY statement to insert COBOL code into a program from a source file member or an IFS file
- Code a REPLACING option to modify a source program being copied
- Code a REPLACE statement to globally change a word or group of words in a source program
- Code a COPY statement to create data description entries using an external database file
- Modify the appearance of a source program listing by using the / (slash), TITLE, EJECT, *CONTROL, and SKIP statements
- Use the COBOL Language Reference manual to determine the proper syntax of a COBOL statement
- Identify the manual in which the answer to a question about COBOL programming can be found
A Sample COBOL Program
Defining Data Items
Coding Procedure Division Statementss
Basic Control Structures
Using Literals and Figurative Constants
Enhancing the Sample Program
Defining and Using Dates
Using the COBOL Copy Facility
Using Reference Manuals
The course is suitable for entry-level programming students with no prior COBOL experience. It can also be taken by COBOL/400 programmers who want to learn ILE COBOL.
Before you begin your study of the material, you should know basic programming concepts and be acquainted with structured programming design techniques. In particular, you will be expected to understand program logic that is documented using pseudocode or structured flowcharts. You may have gained this knowledge from attending classes or from relevant work experience.
This course also assumes that you have a working knowledge of basic IBM i concepts and facilities. You can satisfy this prerequisite by successfully completing the courses in the Introduction to the IBM i Environment series.
Finally, the course also assumes you familiar with IBM i programming concepts and facilities. You can satisfy this prerequisite by successfully completing the courses in The IBM i Programming Environment series.