Rational Programming Patterns

The Program entity

The purpose of the Program entity is to develop and implement all the procedures defined in the detailed analysis phase.

A Program reads and writes files and creates Reports (formatted text files).

The generated read and write operations are adapted to each type of file (sequential, indexed, SQL, and so forth).

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
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 performs 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.
Functions and subfunctions follow one another in the order of their codes, as determined by the EBCDIC collating sequence. Letters precede 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 Structure calls and from possible additional information or updates entered in specific code.
  • The other sections of the DATA DIVISION are generated from the Data Structure calls, completed or updated in specific code.
    When it is generated, the 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 memory dump in case of an abnormal execution.
  • The PROCEDURE DIVISION is generated from the Data Structure or Segment calls, from the processing specified in specific code and from the Macro calls.
Note: For the instances 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 generated code of a Program, see the Batch Applications manual (chapter Example of a generated program), available at the following URL:

http://www-01.ibm.com/support/docview.wss?rs=37&uid=swg27005477


Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)