Message characters in the pattern are either re­
placed by the fill character or remain unchanged in
the result, depending on the state of the significance
indicator. They may thus be used for padding, punc­
tuation, or text in the significant portion of a field or
for the insertion of sign-dependent symbols.
Fill Character: The fill character is obtained from
the pattern as part of the editing operation. The first
character of the pattern is used as the fill character.
The fill character can have any code and may con­
currently specify a control function. If this character
is a digit selector or significance starter, the indicated
editing action is taken after the code has been as­
signed to the fill character.
Source Digits: Each time a digit selector or signifi­
cance starter is encountered in the pattern, a new
source digit is examined for placement in the pattern , field. The source digit either is given a zone and
replaces the pattern character or is disregarded.
The source digits are selected one byte at a time,
and a source byte is fetched for inspection only once
during an editing operation. Each source digit is ex­
amined only once for a zero value. The leftmost four
bits of each byte are examined first, and the right­
most four bits, when they represent a decimal-digit
code, remain available for the next pattern character
that calls for a digit examination. When the leftmost
four bits contain an invalid digit code, the operation
is terminated. At the time the left digit of a source
byte is examined, the rightmost four bits are checked
for the existence of a sign code. When a sign code is
encountered in the four rightmost bit positions, these
bits are not treated as a decimal-digit code, and a
new source byte is fetched from storage for the next
pattern character that calls for a source-digit exami­
nation.
When the source digit is stored in the result, its
code is expanded from the packed to the zoned for­
mat by attaching the zone code 1111.
Significance Indicator: The significance indicator,
by its on or off state, the significance or
nonsignificance, respectively, of subsequent source
digits or message characters. Significant source digits
replace their corresponding digit selectors or signifi­
cance starters in the result. Significant message char­
acters remain unchanged in the result.
The significance indicator, by its on or off state,
indicates also the negative or positive value, respec­
tively, of the source and is used as one factor in the
setting of the condition code.
The indicator is set to the off state, if not already
so set, at the start of the editing operation, after a
field separator is encountered, or after a source byte
is examined that has a plus code in the rightmost
four bit positions. Any of the codes 1010, 1100, 1110, and 1111 is considered a plus code.
The indicator is set to the on state, if not already
so set, when a significance starter is encountered
whose source digit is a valid decimal digit, or when a
digit selector is encountered whose source digit is a
nonzero decimal digit, and if in both instances the
source byte does not have a plus code in the right­
most four bit positions.
In all other situations, the indicator is not
changed. A minus sign code has no effect on the
significance indicator.
Result Characters: The field resulting from an edit­
ing operation replaces and is equal in length to the
pattern. It is composed from pattern characters, fill
characters, and zoned source digits.
If the pattern character is a message character and
the significance indicator is on, the message charac­
ter remains unchanged in the result. If the pattern
character is a field separator or if the significance
indicator is off when a message character is encoun­
tered in the pattern, the fill character replaces the
pattern character in the result.
If the digit selector or significance starter is en­
countered in the pattern with the significance indica­
tor off and the source digit zero, the source digit is
considered nonsignificant, and the fill character re­
places the pattern character. If a digit selector or
significance starter is encountered with either the
significance indicator on or with a nonzero decimal
source digit, the source digit is considered signifi­
cant, is zoned, and replaces the pattern character in
the result.
Result Condition: All digits examined are tested for
the code 0000. The sign of the last field edited and
whether all source digits in the field contain zeros
are recorded in the condition code at the completion
of the editing operation.
The condition code is made 0 when the last field
is zero, that is, when all source digits examined since
the last field separator are zeros. When the pattern
has no digit selectors or significance starters, the
source is not examined, and the condition code is
made O. Similarly, the condition code is made 0 when the last character in the pattern is a field sepa­
rator or when no digit selector or significance starter
is encountered beyond the last field separator.
When the last field edited is nonzero and the sig­
nificance indicator is on, the condition code is made
1 to indicate a result field less than zero.
Decimal Instructions 151
When the last field edited is nonzero and the sig­
nificance indicator is off, the condition code is made
2 to indieate a result field is greater than zero.
Summary: The following table summarizes the func­
tions of the editing operation. The leftmost four
columns list all the significant combinations of the
four conditions that can be encountered in the execu­
tion of an editing operation. The rightmost two
columns llist the action taken for each case --the
type of character placed in the result field and the
new setting of the significance indicator.
Resulting Condition COde: o Last field is zero
1 Last field is less than zero
2 Last field is greater than zero
3 -
Program Exaptiom: Operation (if the decimal feature is not installed)
Access (fetch, operand 2; fetch and store, oper­
and 1)
Data
Conditions
Programming Notes
As a rule, the source is shorter than the pattern be­
cause for each source digit a zone and numeric are
inserted in the result.
The total number of digit selectors and signifi­
cance starters in the pattern must equal the number
of source digits to be edited.
If the fill character is a blank, if no significance
starter appears in the pattern, and if the source is all
zeros, the editing operation blanks the result field.
The resultant condition code indicates whether or
not the last field is all zeros, and, if nonzero, reflects
the state of the significance indicator. The signifi­
cance indicator reflects the sign of the source field
only if the last source byte examined a sign
code in the low-order digit position. For multiple­
field editing operations, the condition code reflects
the sign and value only of the field following the last
field separator.
Edit and Mark
EDMK [SS] \..--.D----I-F _L I o 8 16 20 32 36 47
Results
State of Significance
Previous State of
Significance Indicator
Source Low-Order Source Result I ndicator at End of
Pattern Character Digit Digit Is a Plus Sign
Digit selector starter
Field separator
Message character
Explanation:
off
on
off
on
*
off
on 0 1-9
1-9 0-9 0-9 0 0 1-9
1-9 0-9 0-9 **
* No effect on result character and new state of significance indicator
* * Not applicable because source digit not examined
Summary of EDIT Functions
152 System/370 Principles of Operation no
yes
no
yes
no
yes
no
yes
no
yes
Character Digit Examination
fill character off
source digit on
source digit off
source digit on
source digit off
fill character on
fill character off
source digit on
source digit off
source digit on
source digit off
fill character off
fill character off
message character on
Previous Page Next Page