The purpose of the Program entity is to develop and implement all
the procedures defined in the detailed analysis phase.
A batch Program reads and writes files and creates Reports (formatted text
files).
The generated read and write operations will be adapted to each type of
file (sequential, indexed, SQL, etc).
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 include:
- Getting the data,
- Checking,
- Updating,
- Printing,
- Returning the output.
Each of these processing steps consists of a group of homogeneous sequences
of instructions called 'functions'.
Two other principles structure
a Program:
- The linear sequence of functions in the logical order of their execution.
Each function executes 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 sub-functions which, in turn, can be further
broken down into sub-functions, and so on.
Functions and sub-functions follow one another in the order of their
codes, as determined by the EBCDIC collating sequence, with letters preceding
numbers, regardless of the sorting sequence in effect on the material in use.
Generation principles
Programs are generated upon
request in the
type of COBOL code which corresponds
to the operating system and compiler for which they are designed.
- The COBOL IDENTIFICATION DIVISION is generated from the
Program Definition and possible updates made in specific
code.
- The ENVIRONMENT DIVISION and the FILE SECTION are
generated from the Data Structures' calls and from possible additional information
or updates entered in specific code.
- The other sections of the DATA DIVISION are generated
from the Data Structures' calls, completed or updated in specific code.
Each
generated Program contains, in its
WORKING-STORAGE SECTION,
a
CONSTANTES-PAC field where the following
VALUES are
declared:
- Generation session number of the Program (NUGNA),
- Code of the Library in which the Program is defined (APPLI),
- Generation date of the Program (DATGN) (MM/DD/YY if
user language is English, or DD/MM/YY otherwise),
- Program code (PROGR),
- Code of the user who requested the generation (CODUTI),
- Generation time of the Program (TIMGN),
- External name of the Program (PROGE),
- Database code (COBASE),
- Generation date with century (DATGNC) (MM/DD/CCYY if
the user language is English, or DD/MM/CCYY otherwise),
- Generator version (RELEAS),
- Generator date (DATGE),
- Skeleton date (DATSQ).
These fields can be used in the execution report of the Program. They
are preceded by the
WORKING literal, which can be used as
a tag in a 'dump' in case of an abnormal execution.
- The PROCEDURE DIVISION is generated from the Data Structures'
or Segments' calls, from the processing specified in specific code and from
the Macro calls.
For explanations on the generated Program, refer to the
'Batch Applications' manual (chapter 'Example of a Generated
Program') which you can find at the following URL:
http://www-01.ibm.com/support/docview.wss?rs=37&uid=swg27005477