Shortening Record Length - IBM 1130 User Manual

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

Advertisement

Section
Subsections
Page
80
60
I
00
01
SHORTENING RECORD LENGTH
The following suggestions will help you shorten the
length of disk records.
The first three should be
taken regardless of record length, since they rep-
resent good programming practice and involve little
or no effort. Suggestions 4-7 involve more pro-
gramming effort and core storage. You must deter-
mine how much effort
it
is worth to gain more space
on the disk.
1.
First and foremost, each item in the disk
record should be inspected to determine whether it
really must be in this record. Can it be eliminated
entirely, or placed in a separate file?
2. You should decide whether standard or ex-
tended precision should be used. The decision is
usually based on other considerations; extended
precision is normally used, but it does no harm
to re-ask this question.
3. You should make certain that the *ONE WORD
INTEGERS control record is included when compiling
all programs.
If
not, each integer will occupy two
or three words, depending on the use of standard or '
extended precision.
4. Each real (floating point) field should be
studied with an eye toward converting it to integer
mode. Remember, in most cases integers require
only one word; real fields, three words. Integers
are limited to a magnitude of 32767, but many items
in your application may never exceed this limit,
which may be thought of as
32767
327.67
3.2767
units, pieces
dollars, hours, percent
pay rate, etc
where the decimal points are implied and handled
by you. Some typical items that lend themselves
to such treatment are:
Discount and interest rates
Prices or price differentials
Inventory -- quantity on hand, quantity on
order, etc.
Payroll -- savings bond deduction, city and
state taxes, miscellaneous deductions
5. Alphabetic data should be placed on the disk
with two characters per word (A2) rather than one
(AI). In many cases, data (numeric and alphabetic)
will be read from a card using Al format (one char-
acter per word) for later processing with the Com-
mercial Subroutine Package. Before this data is
written on the disk, it may be compressed into
two-characters-per-word format (A2) , using the
PACK subroutine supplied with CSP. Typical items
in this category include names and addresses, de-
scriptions, Social Security numbers, etc.
6.
If
necessary, three alphabetic characters can
be placed in one word for disk storage. This can be
done by subroutine that involves a table of 40 EBCDIC
codes and a packing/unpacking formula. Only 40
characters are allowed -- for example:
0123456789ABC .................... XYZb-.,
where b signifies a blank.
If
you have just read the three characters B2-
(called LTRl, LTR2, and LTR3 respectively) from
a card with Al format, the subroutine can look up
their positions in the table and find that:
LTRl, a B, is 12th
LTR2, a 2, is 3rd
LTR3, a -, is 38th
Then, using the formula
INA3
=
LTR3 + 40*LTR2+ (LTRI-20)*1600
or INA3
=
38 + 40*3 + (12-20) * 1600
the subroutine obtains -12642.
This is a unique representation of the three char-
acters B2-, and can be placed on the disk as one
word.
To decode after reading from the disk, the sub-
routine manipulates INA3 to obtain LTRl, LTR2,
and LTR3:
I -
I
(32,000 + INA3)/1600 if negative
I -
2
LTR -
I
INA3/1600 + 20
if positive
- 1
LTR2
=
(INA3 - 1600 * LTRl-20)/40
=
3
LTR3
=
(INA3 - 1600 * (LTRI-20) - 40*LTR2)
=
38
Looking up these three codes from the same table,
you may return to Al format.

Advertisement

Table of Contents
loading

Table of Contents