Rational Developer for System z
Enterprise PL/I for z/OS, Version 3.8, Language Reference Manual

Credit, debit, overpunched, and zero replacement characters

The picture characters CR, DB, T, I, and R cannot be used with any other sign characters in the same field.

Credit and debit

The character pairs CR (credit) and DB (debit) specify the signs of real numeric character data items.

CR
Specifies that the associated positions contain the letters CR if the value of the data is <0. Otherwise, the positions will contain two blanks. The characters CR can appear only to the right of all digit positions of a field.
DB
Specifies that the associated positions contain the letters DB if the value of the data is <0. Otherwise, the positions will contain two blanks. The characters DB can appear only to the right of all digit positions of a field.

Overpunch

Any of the picture characters T, I, or R (known as overpunch characters) specifies that a character represents the corresponding digit and the sign of the data item. A floating-point specification can contain two--one in the mantissa field and one in the exponent field. The overpunch character can be specified for any digit position within a field.

The T, I, and R picture characters specify how the input characters are interpreted, as shown in Table 40.

Table 40. Interpretation of the T, I, and R picture characters
T or I
T or R
Digit
Digit with +
Digit with -
Character
Character
{
A
B
C
D
E
F
G
H
I
}
J
K
L
M
N
O
P
Q
R
0
1
2
3
4
5
6
7
8
9

T, I, and R specify the following values:

T
On input, T specifies that the characters { through | and the digits 0 through 9 represent positive values, and that the characters } through R represent negative values.

On output, T specifies that the associated position contains one of the characters { through | if the input data represents positive values, and one of the characters } through R if the input data represents negative values. The T can appear anywhere a '9' picture specification character occurs. For example:

  dcl Credit picture 'ZZV9T';

The character representation is 4 characters; +21.05 is held as '210E', -0.07 is held as 'bb0P'.

I
On input, I specifies that the characters { through | and the digits 0 through 9 represent positive values.

On output, I specifies that the associated position contains one of the characters { through | if the input data represents positive values; otherwise, it contains one of the digits, 0 through 9.

R
On input, R specifies that the characters } through R represent negative values and the digits 0 through 9 represent positive values.

On output, R specifies that the associated position contains one of the characters } through R if the input data represents negative values; otherwise, it contains one of the digits 0 through 9. For example:

  dcl X fixed decimal(3);
  get edit (x) (P'R99');

sets X to 132 on finding '132' in the next three positions of the input stream, but sets X to -132 on finding 'J32'.

Zero replacement

Y
Specifies that a zero in the specified digit position is replaced unconditionally by the blank character.

Table 41 shows examples of credit, debit, overpunched, and zero replacement characters.

Table 41. Examples of credit, debit, overpunched, and zero replacement characters
 
Source Attributes
Source Data
(in constant form)
 
Picture Specification
 
Character Value
FIXED(3)
FIXED(4,2)
FIXED(4,2)
-123
12.34
-12.34
$Z.99CR
$ZZV.99CR
$ZZV.99DB
$1.23CR
$12.34bb
$12.34DB
FIXED(4,2)
FIXED(4)
FIXED(4)
12.34
1021
-1021
$ZZV.99DB
999I
Z99R
$12.34bb
102A
102J
FIXED(4)
FIXED(5)
FIXED(5)
1021
00100
10203
99T9
YYYYY
9Y9Y9
10B1
bb1bb
1b2b3
FIXED(5,2)
000.04
YYYVY9
bbbb4

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)