Examples - IBM 3741 Data Station Reference Manual

Table of Contents

Advertisement

When a control statement will be continued in a higher
numbered buffer, it does not have to be in the next con-
secutive higher numbered buffer. The statement has only
to be continued in a higher numbered buffer.
Program buffer 3
I
<fcccWm,m,m;:
Program buffer 6
I
<fcccWm.
Note: If the compare character m is a colon (:), it is
treated as a compare character. Therefore, if m is a
colon (:), and the control statement will be continued
in a higher numbered buffer, another colon is needed.
~
~control
statement continued
comparing position in record for
I
a colon (:)
<fcccWm.
'-------
....
&
(ampersand) Logical AND
The & (ampersand) can be used in a control statement to
perform a logical AND function. This means that more
than one position in a record can be compared against the
control statement.
<fcccWm&cccWm.
Example: <1010WA&020W4. This control statement is
satisfied if position 10 of the record has an A AN D
position 20 has a 4. Program buffer 1 will be selected to
process the record if the control statement is satisfied.
Examples
The following are examples using all of the control state-
ment format characters that are available.
Example 1: <2002WA,B.
~
,periOd
must be at the end
"of the control statement.
Comma must separate com-
pare characters.
Less than sign must be in
the first position of each
program buffer that
contains a control statement.
This control statement will be satisfied if the current
. . . . data record has an A or B in position 2. Program buffer
2 will be selected if the statement is satisfied.
Example2: <2002WA,B;1010NV.
'Control statement separator
This is a multiple control statement. The field totals
program will first check to see if the data record has an
A or B in position 2. If there is an A or B in position 2,
the control statement is satisfied and program buffer 2
will be selected to process the record. If the first control
statement 2002WA,B is not satisfied, the field totals
program goes to the next control statement (1010NV)
to see if it can be satisfied. This control statement is
satisfied if position 10 of the data record does not have
a V. Program buffer 1 is selected for processing the data
record if this statement is satisfied. If neither statement
is satisfied, the next data record is read.
Example
3:
ILOgiCal AND function
Program buffer 3:
<2002WA,B&031WH;4042:
/.
Program buffer 5:
<W6,7,S.
Control state-
ment con-
tinued in
higher num-
bered buffer
(5).
Control statement
separator.
This is a multiple control statement that is continued in a
higher numbered buffer. The first control statement
(2002WA,B&031WH) contains a logical AND function.
The control statement 2002WA,B&031WH is satisfied if
position 2 of the data record has an A or B AND position
31 has an H. Program buffer 2 is selected to process the
. data record if the statement is satisfied. If this control
statement is not satisfied, the next control statement
(4042W6,7,S) will be used. Note that this control state-
ment is continued in a higher numbered buffer. This
control statement is satisfied if position 42 of the data
record has a 6, 7, or S. Program buffer 4 is selected for
processing the data record if the statement is satisfied. If
neither statement is satisfied, the next data record is read.
Offline Field Totals
45

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents