Offline Field Totals Setup Example - IBM 3741 Data Station Reference Manual

Table of Contents

Advertisement

Program buffer 3 contains the program for the record that
accumulator 1 is to be read into. The accumulator is read
into positions 1 thorugh 10 of the record. The program
also causes accumulator 1 to be reset to zero. The program
in program buffer 3 is:
B 7 •••••••• E
'-.t-'
Field that accumulator 1 is read into
Program buffer 4 contains the program to add the field
in positions 30·35 of the record in accumulator 3 if the
conditions to use the programs in program buffers 1
through 3 are not satisfied. The program in program
buffer 4 is:
B _ •••••• _._ •. _ •• _ ••..••••• _-. N 3--·· E
'-.t-'
Field totals field
in positions 30-35
To cause the program that is to process each record type to
be selected automatically, write control statements. Each
control statement indicates the conditions that must be
satisfied before a program is selected. The control state-
ments for this example begin in program buffer 5. Each
control statement is separated by a semicolon. The colon
is used at the end of program buffers 5 and 6 to indicate
that the control statements are continued in a higher
program buffer. The control statements follow:
Program Buffer 5
<101 OWA&025WB,C
Selects program buffer
1 if position 10 contains
an A and position 25
contains a B or a C.
Program Buffer 6
;2050WO,1,2,3:
~
Selects program buffer
2 if position 50 is
numeric. This control
statement is continued
in program buffer 6.
<,4,5,6, 7 ,8,9;3050W~&051 W~&052W~&053W~&:
~.
~-----------
Continued from
program buffer 5
Selects program buffer 3 if positions
fiO-55 are blank. (The
~
represents
a blank space.) This control statement
is continued in program buffer 7.
Program Buffer 7
<054W~&055W~
;4.
'-
v
",-.-
Continued from
~s
program buffer 4 if another
program buffer 6
program level has not been selected.
Offline Field Totals Setup Example
The following is an example of an easy way to write control
statements when different programs are used for entering
data.
When writing programs required for a job that has field
total fields, set aside one position in the program for
keying the program number used when keying data for
the record. This one position field will assist you in
writing the offline field totals control statements required
to process records in the data set.
For example, assume programs with field totals fields have
been written and are in program buffers 1, 2, and 3. Also,
assume that position 20 in the program represents the
position in the data record into which the program number
being used to control the format of the record wi II be
keyed. Also assume that enter mode has been selected
and data can now be keyed. The first data record requires
program number 1.
Record 1
I'
19-20 21
80
DATA. ......
lit
ATA ..................
·1
A one is keyed into this posi·
tion (20) to indicate that
program number 1 was used
to control the format of this
data record.
The second data record requires program number 2.
Record 2
DATA .......
A two is keyed into this posi·
tion (20) to indicate that
program number 2 was used
to control the format of this
data record.
Offline Field Totals
47

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents