RPG/400 Help
Calculation specifications indicate the operations to
be done on the data in a program. Two general rules govern the writing
of calculation entries:
- Each operation is specified on one line, except when there are AND/OR
lines in the calculation.
- Calculation entries must be grouped in the following order:
- Detail calculations
- Total calculations
- Subroutines.
Calculations within the groups must be specified in the order in which they
are to be done.
Each calculation specifications statement is divided into three parts that
specify the following:
- When calculations are to be done: The conditioning indicators
specified in positions 7 through 17 determine when and under what conditions
the calculations are to be done.
- What kind of calculations are to be done: The entries specified in
positions 18 through 53 determine the kind of calculations to be done, specify
the data (such as fields or files) upon which the operation is to be done, and
specify the field that is to contain the results of the calculation.
- What tests are to be made on the results of the operation:
Indicators specified in positions 54 through 59 are used to test the results
of the calculations and can condition subsequent calculations or output
operations. The resulting indicator positions have various uses,
depending on the operation code.
The calculation specifications are entered on the RPG/400 Calculation
Specifications. See Operation Codes for details on
how these positions must be specified for individual calculation
operations.
The calculation specification can also be used to enter SQL statements into
an RPG/400 program.
See RPG/400* User's Guide and SQL/400*
Reference for more information.
[ Top of Page | Previous Page | Next Page | Table of Contents ]
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.