Programming Note
The TRANSLATE ANDTEST is useful for scanning an in
put stream and locating delimiters. The stream can
thus be rapidly broken into statements or data fields
for further processing.
Edit
ED55 DE L
BlI B2 78 1516 19 20 31 32 35 36 47
The format of the source (the second operand) is
changed from packed to zoned and is edited under
control of the pattern (the first operand). The edited
result replaces the pattern.
Editing includes sign and punctuation control and
the suppressing and protecting of leading zeros. It
also facilitates programmed blanking of all-zero fields.Several numbers may be edited in one operation, and
numeric information may be combined with text.
The length field applies to the pattern (the first op
erand). The pattern has the unpacked format and may
contain any character. The source (the second oper
and) has the packed format and must contain valid
decimal digit and sign codes. The left four bits of a
byte must be0000-1001; the codes 1010-1111 are
recognized as a data exception and cause a program
interruption. The right four bits are recognized as
either a sign or a digit.
Both operands are processed left to right one char
acter at a time. Overlapping pattern and source fields
give unpredictable results.
The character to be stored in the first operand field
is determined by three things: the digit obtained from
the source field, the pattern character, and the state
of a trigger, called theS trigger. One of three actions
may be taken:
1. The source digit is expanded to zoned format
and is stored.
2. The pattern character is left unchanged.
3. A fill character is stored.S Trigger: The S trigger is used to control the stor
ing or replacing of source digits and pattern charac
ters.Source digits are replaced when zero suppression
or protection is desired. Digits to be stored in the re
sult, whether zero or not, are termed significant.Pat tern characters are replaced or stored when they are
significance-dependent (such as punctuation) or sign
dependent (such as credit symbols). TheS trigger
also is used to record the sign of the source number
and set the condition code accordingly.
TheS trigger is set to the zero state at the start of
the operation and is subsequently changed depending
upon the source number and the pattern characters.Pattern Character: Three pattern characters have a
special use in editing. They are the digit-select char
acter, the significance-start character, and the field
separation character. These three characters are re
placed, either by a source digit or by a fill character;
their encoding is shown in the next table.
1. The digit-select character causes either a source
digit or the fill character to be inserted in the result
field.
2. The significance-start character has the same
function but also indicates, by setting theS trigger,
that thefoll0'Ying digits are significant.
3. The field-separator character identifies individual
fields in a multiple-field editing operation. The char
acter is replaced by the fill character. TheS trigger is
set to zero, and testing for a zero-field is then re
initiated.
4. All other pattern characters are treated in a com
mon way: If theS trigger is one, the pattern character
is left unchanged; if theS trigger is zero, the pattern
character is replaced by the fill character.
If the pattern character is either a digit-select or a
significance-start character, the source digit is exam
ined. The source digit replaces the pattern character
if theS trigger is one or if the source digit is nonzero.
If the nonzero digit is inserted when theS trigger is
zero, theS trigger is set to one to indicate that the
subsequent digits are significant. If theS trigger and
the source digit are both zero, the fill character is sub
stituted for the pattern character.
Source Digit: When the source digit is stored in the
result, its code is expanded from the packed to the
zoned format by attaching a zone. When psw bit 12 is
zero, the preferred EBCDIC zone code 1111 is gener
at,ed. When psw bit 12 is one, the preferredASCII zone
code0101 is generated.
The source digits are examined only once during an
editing operation. They are selected eight bits at a
time from the second operand field. The leftmost four
bits are examined first, and the rightmost four bits re
main available for the next pattern character which
calls for a digit examination. However, the rightmost
LogicalOperations 57
The TRANSLATE AND
put stream and locating delimiters. The stream can
thus be rapidly broken into statements or data fields
for further processing.
Edit
ED
Bl
The format of the source (the second operand) is
changed from packed to zoned and is edited under
control of the pattern (the first operand). The edited
result replaces the pattern.
Editing includes sign and punctuation control and
the suppressing and protecting of leading zeros. It
also facilitates programmed blanking of all-zero fields.
numeric information may be combined with text.
The length field applies to the pattern (the first op
erand). The pattern has the unpacked format and may
contain any character. The source (the second oper
and) has the packed format and must contain valid
decimal digit and sign codes. The left four bits of a
byte must be
recognized as a data exception and cause a program
interruption. The right four bits are recognized as
either a sign or a digit.
Both operands are processed left to right one char
acter at a time. Overlapping pattern and source fields
give unpredictable results.
The character to be stored in the first operand field
is determined by three things: the digit obtained from
the source field, the pattern character, and the state
of a trigger, called the
may be taken:
1. The source digit is expanded to zoned format
and is stored.
2. The pattern character is left unchanged.
3. A fill character is stored.
ing or replacing of source digits and pattern charac
ters.
or protection is desired. Digits to be stored in the re
sult, whether zero or not, are termed significant.
significance-dependent (such as punctuation) or sign
dependent (such as credit symbols). The
also is used to record the sign of the source number
and set the condition code accordingly.
The
the operation and is subsequently changed depending
upon the source number and the pattern characters.
special use in editing. They are the digit-select char
acter, the significance-start character, and the field
separation character. These three characters are re
placed, either by a source digit or by a fill character;
their encoding is shown in the next table.
1. The digit-select character causes either a source
digit or the fill character to be inserted in the result
field.
2. The significance-start character has the same
function but also indicates, by setting the
that the
3. The field-separator character identifies individual
fields in a multiple-field editing operation. The char
acter is replaced by the fill character. The
set to zero, and testing for a zero-field is then re
initiated.
4. All other pattern characters are treated in a com
mon way: If the
is left unchanged; if the
character is replaced by the fill character.
If the pattern character is either a digit-select or a
significance-start character, the source digit is exam
ined. The source digit replaces the pattern character
if the
If the nonzero digit is inserted when the
zero, the
subsequent digits are significant. If the
the source digit are both zero, the fill character is sub
stituted for the pattern character.
Source Digit: When the source digit is stored in the
result, its code is expanded from the packed to the
zoned format by attaching a zone. When psw bit 12 is
zero, the preferred EBCDIC zone code 1111 is gener
at,ed. When psw bit 12 is one, the preferred
code
The source digits are examined only once during an
editing operation. They are selected eight bits at a
time from the second operand field. The leftmost four
bits are examined first, and the rightmost four bits re
main available for the next pattern character which
calls for a digit examination. However, the rightmost
Logical