IBM 1130 User Manual page 208

Computing system
Hide thumbs Also See for 1130:
Table of Contents

Advertisement

Example 4: Calculations and Payroll Register
This program cons ists of extens ive calculations and
report writing. Payroll calculations are performed,
including calculations of gross pay, taxes, voluntary
deductions, and net pay. The report shown is the
payroll register.
In addition, the calculations are balanced to con-
trol totals and each disk record is extended with the
current period's calculations.
The following programming techniques have been
used (see Section 35 for progTam listing):
1. Arithmetic Statement Function.
Since the
1130 is a binary computer, decimal fractions may
not be expressed exactly in binary. This inaccuracy
may be avoided by performing all calculations with
whole numbers.
(See Section. 70.10.20.) When
calculations are complete, the result must be half-
adjusted and the decimal point placed. Since there
are many calculations in this program, it makes
sense that the rounding procedure should be set up
only once and accessed from many different places.
The Arithmetic Statement Function, PHIL, will be
used to do this.
2. Use of data switches. Since the check number,
week number, and maximum check amount are not
permanent, a facility must be built into the system
to change them. By setting the console data switches
appropriately (statements 3 + 5 and 71), each or all
of these numbers can be changed. A hard-copy
record of any changes is produced on the console
printer.
3. Zero balance test. The control totals are
compared with accumulations produced during the
Section
Subsections
Page
25
40
I
40
01
processing of the file.
The original control totals,
the accumulated totals, and the differences are
printed.
If the differences are not zero, the oper-
ator knows that further examination of the output is
necessary.
(See statements 15-18.)
4. A variety of calculations.
The calculations
performed with this program are more extensive
than the other sample programs. The first set of
calculations is used to initialize the program vari-
ables, while the second set initializes the plant
variables. The third set initializes the variables
for an individual.
The remaining detail calculations pertain to
regular, overtime, and bonus earnings, taxes (in-
cluding federal, state, and local), and voluntary
deductions.
Finally, the net amount is calculated
and plant totals are accumulated.
5.
Backup is built into the system. To provide
a means of recovery when an error condition or an
out-of-balance condition occurs, the calculated
information (gross, net, tax, etc.) is punched into
the employee's weekly card (see statement 9). A
simple list of these cards will thus supply sufficient
information to check or reconstruct portions of the
file.
6. Another type of half-adjusting.
In
printing
the payroll register the dollar and cents figures
should appear with decimal points. To round off,
reposition the decimal point, and clear fractions,
the WHOLE Function (from the Commercial
Subroutine Package) is used (see statements 515-
515
+
11).
AMT
=
WHOLE (AMT
+
(AMT/ABS(AMT»*0. 5)/100.

Advertisement

Table of Contents
loading

Table of Contents