OVERVIEW
This class provides people with the knowledge and skills needed to code COBOL II application programs. It also covers effective use of the language for report generation using sequential file inputs. The course can easily be divided into two parts; namely a three-day basic, followed by two-day additional COBOL topics.
DURATION: 5 Days
OBJECTIVES
PART I (3-days):
- Describe the concepts of structured programming and apply them to writing COBOL II programs.
- Code JCL for compiling and link-editing a COBOL II program, and the JCL for running a program.
- Apply COBOL II syntax rules, including using compiler messages for correcting syntax problems.
- Define different types of data in the DATA DIVISION and define edited files.
- Code various additional clauses used in the DATA DIVISION, such as REDEFINES and JUSTIFIED
- Use the IF and EVALUATE statements for conditional statement execution.
- Use PERFORM logic to build modular and structured programs.
- Code arithmetic operations using the basic COBOL statements.
- Read and write files from a COBOL II program.
Part II (2-days):
- Define, load and process tables in COBOL II using either subscripting or indexing.
- Code programs that produce single level control breaks with a summary option.
- Code programs that produce multiple level control breaks with a summary option.
- Create, call and process subprograms in static and dynamic environments.
INTENDED AUDIENCE
This course is designed for programmers and programmer/analysts who will be coding and/or maintaining COBOL II application programs.
PREREQUISITES
Working knowledge of the editor (e.g. ISPF) is required for the computer labs. No previous programming experience is necessary, although an understanding of programming logic or data processing concepts is helpful and will allow students to progress quicker.
FORMAT/MATERIALS
This five-day course includes a combination of lecture, discussion and numerous machine workshops. Participants will receive a detailed reference-like manual containing lecture notes and valuable on-the-job information. There is an optional textbook available.
CONTENT
PART I (3 days)
A. Introduction to Programming
1. What is Programming?
2. An Overview of Structured Methodology
3. Developing a COBOL Program
4. General Coding Rules
B. The COBOL Basics
1. Identification Division
a. PROGRAM-ID
b. AUTHOR
c. DATE-WRITTEN
d. DATE-COMPILED
e. Documentation
2. Environment Division
a. CONFIGURATION SECTION
b. INPUT-OUTPUT SECTION
3. LAB 1 - Identification and Environment Divisions
4. Data Division
a. FILE SECTION
b. WORKING-STORAGE SECTION
5. LAB 2 - Data Division
6. Procedure Division
a. Paragraphs
b. Basic Statements
1. Comments
2. OPEN
3. PERFORM
4. CLOSE
5. READ
6. WRITE
7. DISPLAY
8. MOVE
9. IF
10. STOP RUN
7. Preparing a COBOL Program for Execution
a. The Compile Process
b. JCL Requirements
1. Program Preparation
2. Program Execution
8. LAB 3 - Procedure Division
C. Expanding on the Basics
1. Data Division
a. USAGE
b. VALUE Clauses
c. Edited Fields
d. BLANK WHEN ZERO
e. JUSTIFIED
f. REDEFINES
g. Coding Exercise
2. LAB 4a - Additional Data Division (optional)
3. Procedure Division Logic
a. Structured Methodology
b. ACCEPT verb
c. Arithmetic
1. INITIALIZE
2. ADD
3. SUBTRACT
4. MULTIPLY
5. DIVIDE
6. COMPUTE
4. LAB 4b - Additional Procedure Division (optional)
5. Procedure Division Logic (continued)
a. Complex Conditions
1. Compound IF Statements
2. Nested IF Statements
3. EVALUATE
4. Coding Exercise
b. Branches in Logic
1. PERFORM
2. PERFORM UNTIL
3. PERFORM VARYING
4. In-Line Performs
6. LAB 5 - program with IFs and branches
PART II (2-DAYS)
D. Subprograms
1. What is a Subprogram?
2. The CALL Statement
3. The LINKAGE SECTION
4. PROCEDURE DIVISION USING Statement
5. The GOBACK Statement
6. JCL Requirements
7. LAB 6: subprogram problem
E. COBOL Tables
1. What are Tables?
2. Defining a Table
a. The OCCURS Clause
3. Subscripts
a. Defining a Subscript
b. Loading a Table
c. Searching a Table
d. Coding Exercise
4. Indexes
a. Defining an Index
b. SET Verb
c. SEARCH Verb
d. Coding Exercise
5. LAB 7: program using tables
F. Control Break Programs
1. Definition
2. Logic
3. Single-level vs. Multi-Level
4. Lab 8: control break program
G. Appendices
1. COBOL Reserved Words
2. VS COBOL II Compiler Options
3. Glossary
4. Index