Chapter 5. Online Field Totals; Online Field Totals Operation; Displaying Field Totals; Programming Online Field Total Fields - IBM 3741 Data Station Reference Manual

Table of Contents

Advertisement

Chapter 5. Online Field Totals
Field totals can be used for batch auditing, a process some-
times referred to as "hash totals", or for other applications
where totals are required, such as summing the prices of
individual items on an invoice to obtain the total order
cost. Two or more fields within a record can be added and
read out into a summary field in the same record or a fol-
lowing record (crossfooting).
Field totals can be done (1) online on the 3741 during the
process of entering, updating, or verifying records, or (2)
offline, in a separate scan of a batch of records.
ONLINE FIELD TOTALS OPERATION
Three 19-digit accumulators are provided with this feature.
Data can be algebraically summed in these accumulators
from specified fields in any or all records in a batch. The
summation is under control of the program; the program
specifies that a field is to be summed and in which of the
three accumulators the sum will be placed. Field total
fields are identified by following a field defintion character
with a 1, 2, or 3 which specifies which of the three accum-
ulators is to be used. The second and third positions after
the field definition character may be used to cause the field
to be accumulated in two or three accumulators. The length
of the fields used is based on the number of accumulators
that will be used. The minimum field length for one accum-
ulator is 2 positions, 3 positions for 2 accumulators, and
4 positions for 3 accumulators. The low-order 14 digits of
a field total field are added into a specified accumulator.
If overflow beyond 19 digits occurs in an accumulator, it
will not be indicated.
In addition to the numbers 0 through 9, a field total field
may include any of the 256 EBCDIC codes. All codes with
the low-order four bits of the codes equal to 0 through 9
accumulate with numeric values 0 through 9. All other
codes accumulate with a numeric value of zero. All fields
in which the units position codes have the high-order four
bits equal to B or D are considered negative. All other
fields are considered positive.
In online field totals, the accumulators are reset to zero
only when the power is turned on, when a reset is accom-
plished by pressing the R key with field totals displayed, or
when entering a field in a record that is programmed as a
read out and reset field. A good practice is to display field
totals and reset the accumulators before starting an online
field totals operation.
36
During an online field totals operation, the amount that
is added to an accumulator in a given field is equal to the
change that occurs in that field from the time the cursor
comes into the field until the cursor leaves the field. In
enter mode, when the cursor comes into a field, the field
is always blank and its numeric value is zero; therefore,
the amount added to the accumulator is equal to "the
amount entered. In update or verify mode, the amount
added is zero unless the field is modified, and, if so, the
amount added is the algebraic difference obtained by sub-
tracting the initial amount of the field from the final
amount of the field.
The accumulators represent the field totals operations up
to the most advanced record written on disk and any
operations on the current record being processed. When
deleting a record or backspacing to a previous record
from a partially entered, updated, or verify-corrected
record, all accumulated fields are algebraically subtracted
from the specified accumulators. When record back-
spacing from completed records, no subtraction of
accumulator fields occurs as they are backspaced over.
Displaying Field Totals
Field totals accumulators can be displayed when the cursor
is at the beginning of a field by pressing DISPLAY FIELD
TOTALS. Any data currently being displayed is removed
from the screen, and the amounts currently residing in the
accumulatoJs are displayed. At this point the system
accepts only two keys, RESET and R. Pressing R removes
the field totals display, displays the data set label, and
resets all accumulators to zero. Pressing RESET removes
the field totals display and displays the record, but does
not reset the accumulators.
PROGRAMMING ONLINE FIELD TOTAL FIELDS
The following describes how to program the field total
fields for online field totals when you are writing programs
to be used by the operator.

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents