OUTREC Editing numeric fields


PD values are stored as integers in a compressed internal format which is unreadable while printing or displaying the values. OUTREC edit feature can be used to insert signs, commas, decimal points, and hyphens, as appropriate, to make the PD values easy to interpret.

OUTREC edit feature can be used on mostly PD values and it edits the numeric fields using the patterns.

Below are the list of patterns used in numeric fields -

  • I indicate a leading insignificant digit to be displayed as 1-9, or as blank for a leading 0.
  • T indicates a significant digit to be displayed as 0-9.
  • S before the digits indicates a leading sign. S after the digits indicates a trailing sign.
  • Any other character is just displayed as the same.

Below table provides the cear understanding about each format with example -

Format Format displayValue passed Displaying Value
M0IIIIIIIIIIIIIIIIIIIIIIIIIIIIIITS+01234
-00001
1234
1-
M1TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTS-00123
+00123
00123-
00123
M2II,III,III,III,III,III,III,III,III,IIT.TTS +123450
1,234.50
-000020
0.20-
M3II,III,III,III,III,III,III,III,III,IIT.TTCR-001234
+123456
12.34CR
1,234.56
M4SII,III,III,III,III,III,III,III,III,IIT.TT +0123456
-1234567
+1,234.56
-12,345.67
M5SII,III,III,III,III,III,III,III,III,IIT.TTS-001234
+123450
(12.34)
1,234.50
M6III-TTT-TTTT 00123456
12345678
012-3456
1-234-56788
M7TTT-TT-TTTT 00123456
12345678
000-12-3456
012-34-5678
M8IT:TT:TT030553
121736
3:05:53
12:17:36
M9IT/TT/TT 123004
083104
12/30/04
8/31/04
M10IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIT01234
000000
1234
M11TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT00010
01234
00010
01234
M12SI,III,III,III,III,III,III,III,III,III,IIT +1234567
-0012345
1,234,567
-12,345
M13SI.III.III.III.III.III.III.III.III.III.IIT +1234567
-0012345
1.234.567
-12.345
M14SI III IIIIIIIIIIIIIIIIIIIIIIII IITS +1234567
-0012345
1 234 567
(12 345)
M15I III IIIIIIIIIIIIIIIIIIIIIIII IITS +1234567
-0012345
1 234 567
12 345-
M16SI III IIIIIIIIIIIIIIIIIIIIIIII IIT+1234567
-0012345
1 234 567
-12 345
M17SI'III'III'III'III'III'III'III'III'III'IIT+1234567
-0012345
1'234'567
-12'345
M18SII,III,III,III,III,III,III,III,III,IIT.TT+0123456
-1234567
1,234.56
-12,345.67
M19SII.III.III.III.III.III.III.III.III.IIT,TT+0123456
-1234567
1.234,56
-12.345,67
M20SI III IIIIIIIIIIIIIIIIIIIII IIT,TTS +0123456
-1234567
1 234,56
(12 345,67)
M21II III IIIIIIIIIIIIIIIIIIIII IIT,TTS +0123456
-1234567
1 234,567
12 345,67-
M22SI III IIIIIIIII IIII III IIIIII IIT,TT +0123456
-1234567
1 234,56
-12 345,67
M23SII'III'III'III'III'III'III'III'III'IIT.TT +0123456
-1234567
1'234.56
-12'345.67
M24SII'III'III'III'III'III'III'III'III'IIT,TT+0123456
-1234567
1'234,56
-12'345,67
M25SIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIT +01234
-00001
1234
-1
M26STTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT 1234
-1
+01234
-00001

Examples -


Scenario1 - Editing a zoned decimal field with commas and decimal points.

//SYSIN   DD  *
  SORT FIELDS=COPY
  OUTREC FIELDS=(1,10,11,5,ZD,M11,LENGTH=10)
/*

Edits the 5-byte zoned decimal field starting at position 11 by applying the M11 mask, which formats the number with commas and decimal points. The edited field will have a total length of 10 characters.

Scenario2 - Editing a packed decimal field to include a leading sign.

//SYSIN   DD  *
  SORT FIELDS=COPY
  OUTREC FIELDS=(1,10,15,4,PD,M11,LENGTH=8)
/*

Edits the 4-byte packed decimal field starting at position 15 by using the M11 mask to include commas, a decimal point, and a sign. The result will be an 8-character formatted field.

Scenario3 - Formatting a binary field with leading zeros.

//SYSIN   DD  *
  SORT FIELDS=COPY
  OUTREC FIELDS=(1,10,20,4,BI,M0,LENGTH=6)
/*

Formats the 4-byte binary field starting at position 20, with a M0 mask to include leading zeros, making the final field 6 characters long.