IBM 1130 User Manual page 209

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

Advertisement

Section
Subsections
Page
25
40
I
50
01
Example 5: Check Writing
This program demonstrates the use of the Com-
mercial Subroutine Package (CSP) in preparing a
report--namely, the check and check stub.
In this example, the employee file is accessed
sequentially. If the paid indicator is set appropri-
ately, a check is written. In either case, the next
employee record is read.
Control totals are carried, and a zero-balance
check is performed.
The following programming techniques should be
noted in this program (see Section 35):
1.
The use of subroutines. There are three
specific operations which are used many times (see
statements 91 + 9 - 95 + 5). These are PUT, MOV E,
and EDIT. PUT converts from real format to Al
format, MOVE moves information, and EDIT inserts
and removes characters. Rather than repeating the
statements that perform these three operations each
time, it is much simpler and shorter to make sub-
routines out of the statements. This, in addition to
saving core storage, is much easier to test and
document. All three subroutines are supplied with
the 1130 Commercial Subroutine Package.
2. Editing data for output. The use of the EDIT
subroutine is a very powerful technique.
It requires
two kinds of data. The first is the data to be edited,
and the second is a description of the result, the edit
mask. As can be seen, the edit mask is treated as
a constant and is initialized at the beginning of the
program (see statement 4). The result of editing
can be seen in the amount field of the check speciman
shown.

Advertisement

Table of Contents
loading

Table of Contents