Miscellaneous
This appendix describes miscellaneous information such as data formats and constants used in ProSort.
1. Data Formats
Data formats used in ProSort are as follows:
-
CH
Expresses strings by using the ASCII or EBCDIC code.
-
If the USE_CH_EBCDIC parameter is Y, each character is expressed with the 8-bit EBCDIC code. For example, PS3 is expressed as D7E2F3 (hexadecimal).
-
If the USE_CH_EBCDIC parameter is N, each character is expressed with the ASCII code. For example, PS3 is expressed as 505333 (hexadecimal).
-
-
TP
Expresses numbers by using the decimal ASCII code. A sign is expressed in the last byte.
-
If the USE_ALTERNATIVE_TP_TYPE parameter is Y, the last byte is converted as follows:
Sign Description Positive
-
Conversion rule
'0'→'0', '1'→'1', '2'→'2', '3'→'3', '4'→'4', '5'→'5', '6'→'6', '7'→'7', '8'→'8', '9'→'9'
For example, 123 is expressed as 123.
Negative
-
Conversion rule
'0'→'}', '1'→'J', '2'→'K', '3'→'L', '4'→'M', '5'→'N', '6'→'O', '7'→'P', '8'→'Q', '9'→'R'
For example, -123 is expressed as 12L.
-
-
If the USE_ALTERNATIVE_TP_TYPE parameter is N, the last byte is converted as follows:
Sign Description Positive
-
Conversion rule
'0'→'{', '1'→'A', '2'→'B', '3'→'C', '4'→'D', '5'→'E', '6'→'F', '7'→'G', '8'→'H', '9'→'I'
For example, 123 is expressed as 12C.
Negative
-
Conversion rule
'0'→'}', '1'→'J', '2'→'K', '3'→'L', '4'→'M', '5'→'N', '6'→'O', '7'→'P', '8'→'Q', '9'→'R'
For example, -123 is expressed as 12L.
-
-
-
ZD
Expresses numbers by using the decimal ASCII code. A sign is expressed in the last byte.
The last byte is converted as follows:
Sign Description Positive
-
Conversion rule
'0'→'0', '1'→'1', '2'→'2', '3'→'3', '4'→'4', '5'→'5', '6'→'6', '7'→'7', '8'→'8', '9'→'9'
For example, 123 is expressed as "123".
Negative
-
Conversion rule
'0'→'p', '1'→'q', '2'→'r', '3'→'s', '4'→'t', '5'→'u', '6'→'v', '7'→'w', '8'→'x', '9'→'y'
For example, -123 is expressed as "12s".
-
-
PD
Expresses each digit of numbers by using 4 bits. A sign is expressed in the last 4 bits (nibble).
Since PD requires only 4 bits for each digit while ZD requires 1 byte, PD can express numbers with less space. This is the reason why the format is called packed decimal (PD).
Each byte is converted to a nibble as follows:
'0'→X'0', '1'→X'1', '2'→X'2', '3'→X'3', '4'→X'4', '5'→X'5', '6'→X'6', '7'→X'7', '8'→X'8', '9'→X'9'
A nibble for a sign is added at the end as follows:
Sign Description Positive
-
Conversion rule
X'C'
For example, 123 is expressed as 123C (hexadecimal).
Negative
-
Conversion rule
X'D'
For example, -123 is expressed as 123D (hexadecimal).
-
-
FI
Expresses numbers by using the fixed-point representation system. A sign is expressed in the first bit.
Sign Description Positive
-
Conversion rule
0
For example, +247 is expressed as 00F7 (hexadecimal).
Negative
-
Conversion rule
1
Expressed with two’s complement. For example, -247 is expressed as FF09 (hexadecimal).
-
-
BI
Expresses numbers by using unsigned binary numbers, which consist of an arbitrary bit pattern.
-
AC
Expresses each character by using the ASCII code. For example, PS3 is expressed as 505333 (hexadecimal).
-
EC
Expresses each character by using the 8-bit EBCDIC code. For example, PS3 is expressed as D7E2F3 (hexadecimal).
Examples
The following expresses '-247' in the ZD format.
2 |
4 |
7 |
Decimal |
F2 |
F4 |
D7 |
Hexadecimal |
11110010 |
11110100 |
11010111 |
Binary |
The following expresses '+247' in the ZD format.
F2 |
F4 |
C7 |
11110010 |
11110100 |
11000111 |
The following expresses '-247' in the PD format.
2 |
4 |
7- |
Decimal |
2 |
4 |
7D |
Hexadecimal |
0010 |
0100 |
01111101 |
Binary |
+246 is expressed as 247C (hexadecimal).
2. Data Formats and Maximum Lengths for Comparison Fields
| Data Format | Maximum Length | Description |
|---|---|---|
ZD |
64 bytes |
Signed zoned decimal |
PD |
64 bytes |
Signed packed decimal |
FI |
64 bytes |
Signed fixed point |
BI |
64 bytes |
Unsigned binary |
AC |
64 bytes |
ASCII character |
EC |
64 bytes |
EBCDIC character |
3. Constants
Constants used in ProSort are as follows:
-
Decimal numbers
Numbers in the format of xxxxx.
100, 1000, 2345
-
Character strings
Character strings in the format of C’xxx…x'.
C'ASDF', C'Test'
-
Hexadecimal strings
Hexadecimal character strings in the format of X’yy…yy'.
X'ABCD', X'BF3C', X'AF050505', X'BF3C'
4. Edit Mask Patterns
Edit mask patterns are used to change the format and length of fields.
The patterns consist of the following elemepdf nts.
| Element | Description |
|---|---|
I |
Insignificant digit. 0 is not outputted. |
T |
Significant digit. 0 is outputted. |
CR |
Can be used only for the M3 mask. Negative values are outputted, and two blank spaces are outputted for non-negative values. |
S |
Sign symbol (+/-). |
The following are pre-defined patterns and their examples.
| Mask | Pattern | Example Value | Result |
|---|---|---|---|
M0 |
IIIIIIIIIIIIIITS |
+01234 |
1234 |
-00001 |
1- |
||
M1 |
TTTTTTTTTTTTTTTS |
-00123 |
00123- |
+00123 |
00123 |
||
M2 |
I,III,III,III,IIT.TTS |
+123450 |
1,234.50 |
-000020 |
0.20- |
||
M3 |
I,III,III,III,IIT.TTCR |
-001234 |
12.34CR |
+123456 |
1,234.56 |
||
M4 |
SI,III,III,III,IIT.TT |
+0123456 |
+1,234.56 |
-1234567 |
-12,345.67 |
||
M5 |
SI,III,III,III,IIT.TTS |
-001234 |
(12.34) |
+123450 |
1,234.50 |
||
M6 |
III-TTT-TTTT |
00123456 |
012-3456 |
12345678 |
1-234-56788 |
||
M7 |
TTT-TT-TTTT |
00123456 |
000-12-3456 |
12345678 |
012-34-5678 |
||
M8 |
IT:TT:TT |
030553 |
3:05:53 |
121736 |
12:17:36 |
||
M9 |
IT/TT/TT |
123094 |
12/30/94 |
083194 |
8/31/94 |
||
M10 |
IIIIIIIIIIIIIIT |
01234 |
1234 |
00000 |
0 |
||
M11 |
TTTTTTTTTTTTTTT |
00010 |
00010 |
01234 |
01234 |
||
M12 |
SIII,III,III,III,IIT |
+1234567 |
1,234,567 |
-0012345 |
-12,345 |
||
M13 |
SIII.III.III.III.IIT |
+1234567 |
1.234.567 |
-0012345 |
-12.345 |
||
M14 |
SIII III III III IITS |
+1234567 |
1 234 567 |
-0012345 |
(12 345) |
||
M15 |
III III III III IITS |
+1234567 |
1 234 567 |
-0012345 |
12 345- |
||
M16 |
SIII III III III IIT |
+1234567 |
1 234 567 |
-0012345 |
-12 345 |
||
M17 |
SIII’III’III’III’IIT |
+1234567 |
1’234’567 |
-0012345 |
-12’345 |
||
M18 |
SI,III,III,III,IIT.TT |
+0123456 |
1,234.56 |
-1234567 |
-12,345.67 |
||
M19 |
SI.III.III.III.IIT,TT |
+0123456 |
1.234,56 |
-1234567 |
-12.345,67 |
||
M20 |
SI III III III IIT,TTS |
+0123456 |
1 234,56 |
-1234567 |
(12 345,67) |
||
M21 |
I III III III IIT,TTS |
+0123456 |
1 234,567 |
-1234567 |
12 345,67- |
||
M22 |
SI III III III IIT,TT |
+0123456 |
1 234,56 |
-1234567 |
-12 345,67 |
||
M23 |
SI’III’III’III’IIT.TT |
+0123456 |
1’234.56 |
-1234567 |
-12’345.67 |
||
M24 |
SI’III’III’III’IIT,TT |
+0123456 |
1’234,56 |
-1234567 |
-12’345,67 |
||
M25 |
SIIIIIIIIIIIIIIT |
+01234 |
1234 |
-00001 |
-1 |
||
M26 |
STTTTTTTTTTTTTTT |
1234 |
+01234 |
-1 |
-00001 |