IBM 1130 User Manual page 567

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

Advertisement

Section
Subsections
Page
70
50
I
10
02
Case 4: Creating Alphabetic Masks for the
EDIT Subroutine
If you want to print or punch you.r FOR TRAN re-
sults with commas, floating dollar signs, etc., you
are probably using the EDIT subroutine found in CSP.
This subroutine requires an Edit mask, which may
look like
bb, bb$. bbCR
There are two ways to obtain this mask, which must
be in Al format in an eleven-word integer array
(call it MASK). You can read it off a card, or you
can look up the decimal equivalents of the EBCDIC
codes, and set each one equal to the desired
character:
MASK (1)
=
16448 blank
MASK (2)
=
16448 blank
MASK (3)
=
27456 comma
MASK (4)
=
16448 blank
MASK (5)
=
16448 blank
MASK (6)
=
23360 dollar sign
MASK (7)
=
19264 period
MASK (8)
=
16448 blank
MASK (9)
=
16448 blank
MASK (10)
=
-15552 letter C
MASK (11)
=
-9920 letter R
The DATA statement allows you to eliminate this
sixty-six-word series of commands, replacing it with
DATA MASK/'b', 'b',',', 'b', 'b', '$', '.', 'b', 'b', 'C', 'R'/
where b indicates a blank.
Keep FORMAT Statements Compact
1130 FORTRAN includes a very flexible repertoire
of FORMAT codes, and often gives you several
different ways to achieve the same results.
For
example, you can specify either (F6.2, F6.2, F6.2)
or (3F6. 2). With alphabetic heading data, there are
more options. To type a line which reads
bbbbbbbbbTOT AL
you can use as FORMAT statements the following:
a. FORMAT (14HbbbbbbbbbTOT AL)
b. FORMAT('bbbbbbbbbTOTAL')
c. FORMAT(9X, 'TOTAL')
d. FORMAT(9X,5HTOTAL)
etc.
If you suspected that some options used more core
storage than others, you would be correct. Options
a and b force the compiler to allocate nine words for
this FORMAT STATEMENT; options c and d only
require six words.
The main difference between the two styles is the
manner in which you have generated nine blank
columns -- 9X or 'bbbbbbbbb'. The 9X is coded and
compressed into one word; the 'bbbbbbbbb' requires
one word, plus a string of five words, each contain-
ing two alphabetic blanks.
The difference does not appear to be great, but
consider your typical commercial report writing
program with its many long FORMAT statements.
The difference between the best (smallest core
requirement) and what the programmer has actually
used may be substantial.
This topic is further complicated by the fact that
the X specification is best for large numbers of
spaces, while the literal or ' , specification is best
for small numbers.
In
summary, to get one or two
spaces, it is best to enclose blanks within quotes
(or use the H specification). To get three or more
spaces, use the X specification.

Advertisement

Table of Contents
loading

Table of Contents