The Program entity
The purpose of the Program entity is to develop and implement all the procedures that are defined in the detailed analysis phase.
A Program reads and writes files and creates Reports, which are formatted text files.
The generated read and write operations are adapted to each type of file (sequential, indexed, or SQL for example).
The structure of each file and the controls to perform on the records are defined in a Data Structure.
Program structure
A Program is organized
as a set of successive processing steps. These processing steps are
as follows:
- Getting the data
- Checking
- Updating
- Printing
- Returning the output
Two other
principles structure a Program:
- The linear sequence of functions in the logical order of their execution. Each function completes a functional or technological task in the Program. A function is identified by a code from 0A to 99.
- The hierarchical structuring of the processing steps in each function. A function can be broken down into subfunctions which, in turn, can be further broken down into subfunctions.
Generation principles
The generated COBOL
code varies according to the type of COBOL code that
corresponds to the operating system and compiler.
- The COBOL IDENTIFICATION DIVISION is generated from the Program Definition and from possible specific code insertions.
- The ENVIRONMENT DIVISION and the FILE SECTION are generated from the Data Structure calls and from possible specific code insertions.
- The other sections of the DATA DIVISION are generated from the Data Structure calls and from possible specific code insertions.
- The PROCEDURE DIVISION is generated from the Data Structure or Segment calls, from possible specific code insertions, and from the Macro calls.
Note: For the instances that are
imported from Pacbase, the skeleton language of the local generation
is identical to the Pacbase skeleton language. This piece of information
is retrieved from the extraction of the Pacbase models and from the
import. It is stored in the Library.
For explanations on the contents of the generated code, see COBOL description of a generated Program.