z/OS DFSORT Application Programming Guide
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


DFSORT data formats

z/OS DFSORT Application Programming Guide
SC23-6878-00

DFSORT supports a large number of data formats as described below.

DFSORT data formatsFormat
Description
CH (character EBCDIC, unsigned). Each character is represented by its 8-bit EBCDIC code.

Example: AB7 becomes
C1       C2       F7        Hexadecimal
11000001  11000010 11110111   Binary

Note:
  1. If CHALT is in effect, a format CH field collates according to the ALTSEQ (alternate collating sequence) table in effect. AQ format can be used for the same purpose.
  2. If locale processing is in effect, a format CH field collates according to the collating rules of the active locale.
ZD (zoned decimal, signed). Each digit of the decimal number is converted into its 8-bit EBCDIC representation. The sign indicator replaces the first four bits of the low order byte of the number.

Example: -247 becomes
2        4        - 7     Decimal
F2       F4       D7     Hexadecimal
11110010 11110100 11010111   Binary
The number +247 becomes
F2       F4         C7
11110010 11110100 11000111

Note:
  1. The following are treated as positive sign indicators: F, E, C, A, 8, 6, 4, 2, 0.
  2. The following are treated as negative sign indicators: D, B, 9, 7, 5, 3, 1.
  3. For SUM processing, 0 through 9 for the sign or A through F for a digit results in a data exception (0C7 ABEND). For example, a ZD value such as 3.5 (X'F34BF5') results in an 0C7 because B is treated as an invalid digit. ICETOOL's DISPLAY or VERIFY operator can be used to identify ZD values with invalid digits. ICETOOL's VERIFY operator can be used to identify ZD values with invalid signs.
  4. The first four bits of the last digit is the sign indicator. The first four bits of each other digit is ignored. Thus the EBCDIC strings '0025' and '  25' are both treated as 25 because a leading blank (X'40') is equivalent to a 0 digit (X'F0').
PD (packed decimal, signed). Each digit of the decimal number is converted into its 4-bit binary equivalent. The sign indicator is put into the rightmost four bits of the number.

Example: -247 becomes
2   4    7-     Decimal
2   4    7D     Hexadecimal
00100100 01111101    Binary
The number +247 becomes 247C in hexadecimal.

Note:
  1. The following are treated as positive sign indicators: F, E, C, A, 8, 6, 4, 2, 0.
  2. The following are treated as negative sign indicators: D, B, 9, 7, 5, 3, 1.
  3. For SUM processing, 0 through 9 for the sign or A through F for a digit results in a data exception (0C7 ABEND). For example, a PD value such as X' 0123BF' results in an 0C7 because B is treated as an invalid digit. ICETOOL's DISPLAY or VERIFY operator can be used to identify PD values with invalid digits. ICETOOL's VERIFY operator can be used to identify PD values with invalid signs.
PD0 (packed decimal, with sign and first digit ignored) The PD0 format can be represented as follows:
xddd...ds

x is hexadecimal 0-F and is ignored.
d is hexadecimal 0-9 and represents a decimal digit.
s is hexadecimal 0-F and is ignored.

PD0 can be used for parts of PD fields. For example, in the PD field P'mmddyy' (hexadecimal 0mmddyyC), PD0 can be used separately for 0mmd (mm), mddy (dd) and dyyC (yy).

FI (fixed-point, signed). The complete number is represented by its binary equivalent with the sign indicator placed in the most significant bit position. 0 for + or 1 for -. Negative numbers are in 2's complement form.
Example: +247 becomes in halfword form
00F7              Hexadecimal
0000000011110111  Binary
         -247 becomes in halfword form
FF09             Hexadecimal
1111111100001001 Binary                                
BI (binary unsigned). Any bit pattern.
FL ( hexadecimal floating-point, signed). The specified number is in the two-part format of characteristic and fraction with the sign indicator in bit position 0.
Example: +247 becomes
42F70000...                       Hexadecimal
0 1000010 111101110000000.......  Binary
+ chara.  Fraction
-247 is identical, except that the sign bit is changed to 1.
C2F70000...                       Hexadecimal
1 1000010 111101110000000.......  Binary
- chara.  Fraction                                       
AQ (character EBCDIC, with alternate collating sequence, unsigned). This is similar to format CH, but the characters collate according to the ALTSEQ (alternate collating sequence) table in effect.
AC (character EBCDIC, with ASCII collating sequence, unsigned). This is similar to format CH, but the characters collate according to the ASCII collating sequence.
D1 (EFS type).

User-defined data type (requires an EFS program)

D2 (EFS type).

User-defined data type (requires an EFS program)

CSF or FS (signed numeric with optional leading floating sign).
The floating sign format can be represented as follows:

<s>d . . .d

s is an optional sign immediately to the left of the digits d . . .d. If s is a -, the number is treated as negative, otherwise it is treated as positive. Thus, - must be used for a minus sign, but any other character (for example, + or blank) can be used for a plus sign. The first non-decimal digit (that is, not 0-9) going from right to left is treated as the sign and anything to the left of the sign is ignored.
Examples:
Value:     Treated as:
    34             +34
   +34             +34
 00034             +34
  -003              -3
--1234           -1234
  1234           +1234
+01234           +1234
     0              +0
The types of data handled by the CSF or FS format encompass those produced by several different FORTRAN, PL/I and COBOL formats, such as those shown below (using a width of 4 for purposes of illustration):

* FORTRAN:  I4 ; G4.0 ; SP,I4 ; SP,I4.3 ; S,I4.3
* PL/I:  F(4) ; P'S999' ; P'SSS9' ; P'---9'
* COBOL:  PIC ++9 ; PIC +999 ; PIC ++++ ; PIC ---9 ; PIC ---- ; PIC ZZZZ

UFF (unsigned free form numeric).

This format extracts decimal digits (0-9) from right to left anywhere in the field to form a positive number. Any combination of characters is valid, but characters other than 0-9 are ignored.

Examples:
              Value:         Treated as:
      $58,272,300.10         +5827230010
      $58,272,300.1           +582723001
         $58,272,300           +58272300
          12-31-2004           +12312004
   (402)-125-3721XXX         +4021253721
  G1***    52 $ 21 R              +15221
000128637.240                 +128637240
+400.52                           +40052
+400.1                             +4001
    173/821/9072/@3         +17382190723
       ABC                            +0
SFF (signed free form numeric).

This format extracts decimal digits (0-9) from right to left anywhere in the field to form a positive or negative number. If - or ) is found anywhere in the field, the number is treated as negative, otherwise it is treated as positive. Any combination of characters is valid, but characters other than 0-9, - and ) are ignored.

Examples:
             Value:          Treated as:
     358,272,300.10         +35827230010
     358,272,300.1           +3582723001
       -358,272,300           -358272300
        (82,316.90)             -8231690
         12-31-2004            -12312004
 G1***    52 $ 21 R               +15221
 G1***  ) 52 $ 21 R               -15221
000128637.240                 +128637240
400.52-                           -40052
  ($400.5)                         -4005
    173/821/9072/@3         +17382190723
   X,Y,Z                              +0
CSL or LS (signed number, leading separate sign). This format refers to decimal data as punched into cards, and then assembled into EBCDIC code.

Example: +247 punched in a card becomes
+          2       4        7      Punched numeric data
4E         F2      F4       F7     Hexadecimal
01001110  11110010 11110100 11110111   Binary EBCDIC code
-247 becomes
-          2        4        7      Punched numeric data
60         F2       F4       F7     Hexadecimal
01100000  11110010 11110100  11110111   Binary EBCDIC code

Note: A value with '-' as the leading sign character is treated as a negative value. A value with any leading sign character other than '-' (for example, '+' (plus) or blank) is treated as a positive value.
CST or TS (signed numeric, trailing separate sign). This has the same representation as the CSL format, except that the sign indicator is punched after the number.

Example: 247+ punched on the card becomes
F2  F4  F7  4E  Hexadecimal

Note: A value with '-' as the trailing sign character is treated as a negative value. A value with any trailing sign character other than '-' (for example, '+' (plus) or blank) is treated as a positive value.
CLO1 or OL1 (signed numeric, leading overpunch sign). This format again refers to decimal data punched into cards and then assembled into EBCDIC code. The sign indicator is, however, overpunched with the first decimal digit of the number.

Example: +247 with + overpunched on 2 becomes
+2       4        7       Punched numeric data
C2       F4       F7      Hexadecimal
11000010 11110100 11110111   Binary EBCDIC code
Similarly -247 becomes
D2       F4       F7

CTO or OT (signed numeric, trailing overpunch sign). This format has the same representation as for the CLO format, except that the sign indicator is overpunched on the last decimal digit of the number.

Example: +247 with + overpunched on 7 becomes
F2 F4 C7 hexadecimal

ASL (signed numeric, ASCII, leading separate sign). Similar to the CSL format but with decimal data assembled into ASCII code.

Example: +247 punched into card becomes
+        2        4        7       Punched numeric data
2B       32       34       37      Hexadecimal
0101011 00110010 00110100 00110111  Binary ASCII code
Similarly -247 becomes
2D 32 34 37 hexadecimal

Note: A value with '-' as the leading sign character is treated as a negative value. A value with any leading sign character other than '-' (for example, '+' (plus) or blank) is treated as a positive value.
AST (signed numeric, ASCII, trailing separate sign). This gives the same bit representation as the ASL format, except that the sign is punched after the number.

Example: 247+ becomes
32 34 37 2B hexadecimal

Note: A value with '-' as the trailing sign character is treated as a negative value. A value with any trailing sign character other than '-' (for example, '+' (plus) or blank) is treated as a positive value.

In the date formats below, unless specified otherwise, yy represents the two-digit year (00-99), ddd represents the day of the year (001-366), ccyy represents the four-digit year, mm represents the month (01-12), dd represents the day (01-31), x represents a decimal digit (0-9), s is hexadecimal 0-F and is ignored, and c represents the century indicator (c=0 is transformed to 19, c=1 is transformed to 20 and c>1 is transformed to 21).

In the date formats below, unless specified otherwise, yy represents the two-digit year (00-99), ddd represents the day of the year (001-366), ccyy represents the four-digit year, mm represents the month (01-12), dd represents the day (01-31), x represents a decimal digit (0-9), s is hexadecimal 0-F and is ignored, and c represents the century indicator (c=0 is transformed to 19, c=1 is transformed to 20 and c>1 is transformed to 21).Format
Description
Y2T, Y2W, Y4T, Y4W (character or zoned decimal date format with special indicators).
The date field can be represented as follows:

3,Y2T:  C'yyx' or Z'yyx'
4,Y2T:  C'yyxx' or Z'yyxx'
5,Y2T: C'yyddd' or Z'yyddd'
6,Y2T: C'yymmdd' or Z'yymmdd'
7,Y4T: C'ccyyddd' or Z'ccyyddd'
8,Y4T: C'ccyymmdd' or Z'ccyymmdd'

3,Y2W: C'xyy' or Z'xyy'
4,Y2W: C'xxyy' or Z'xxyy'
5,Y2W: C'dddyy' or Z'dddyy'
6,Y2W: C'mmddyy' or Z'mmddyy'
7,Y4W: C'dddccyy' or Z'dddccyy'
8,Y4W: C'mmddccyy' or Z'mmddccyy'

The special indicators are X'00...00' (BI zeros), X'40...40' (blanks), C'0...0' (CH zeros), Z'0...0' (ZD zeros), C'9...9' (CH nines), Z'9...9' (ZD nines) and X'FF...FF' (BI ones).

Y2U, Y2V, Y2X, Y2Y, Y4U, Y4V, Y4X, Y4Y (packed decimal date format with special indicators).
The date field can be represented as follows:

2,Y2U:  P'yyx'  (X'yyxs')
3,Y2V: P'yyxx' (X'0yyxxs')
3,Y2U: P'yyddd' (X'yyddds')
4,Y2V: P'yymmdd' (X'0yymmdds')
4,Y4U: P'ccyyddd' (X'ccyyddds')
5,Y4V: P'ccyymmdd' (X'0ccyymmdds')

2,Y2X: P'xyy' (X'xyys')
3,Y2Y: P'xxyy' (X'0xxyys')
3,Y2X: P'dddyy' (X'dddyys')
4,Y2Y: P'mmddyy' (X'0mmddyys')
4,Y4X: P'dddccyy' (X'dddccyys')
5,Y4Y: P'mmddccyy' (X'0mmddccyys')

The special indicators are P'0...0' (PD zeros) and P'9...9' (PD nines).

Y2C or Y2Z (two-digit, two-byte character or zoned-decimal year data). The two-digit year data can be represented as follows:

xyxy

y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-F and is ignored.

Thus, 96 might be represented as hexadecimal F9F6 (character 96) or as hexadecimal F9C6 or 0906 (zoned decimal 96).

Y2P (two-digit, two-byte packed-decimal year data). The two-digit year data can be represented as follows:

xyyx

y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-F and is ignored.

Thus, 96 might be represented as hexadecimal 096F or 896C (packed decimal 96).

Y2D (two-digit, one-byte decimal year data). The two-digit year data can represented as follows:

yy

y is hexadecimal 0-9 and represents a year digit.

Thus, 96 would be represented as hexadecimal 96 (decimal 96).

Y2S (two-digit, two-byte character or zoned-decimal year data with special indicators).

The two-digit year data can represented as follows:

xyxy

y is hexadecimal 0-9 and represents a year digit. x is hexadecimal 0-F and is ignored.

Thus, 96 might be represented as hexadecimal F9F6 (character 96) or as hexadecimal F9C6 or 0906 (zoned decimal 96).

The special indicators can be represented as follows:

qxzx

qx is hexadecimal 00, 40 or FF. zx is hexadecimal 00-FF (although typically 00, 40 and FF).

Thus, special indicators might be hexadecimal 0000, 0005, 4040, FFFF, FF85 and so on.

Y2B (two-digit, one-byte binary year data). The binary year data can be represented as follows:

hh

hh is the hexadecimal equivalent of a decimal yy value as follows:
Binary Values    Decimal Values        yy
X'00'-X'63'           00-99            00-99
X'64'-X'C7'          100-199           00-99
X'C8'-X'FF           200-255           00-55

Thus, 96 might be represented as hexadecimal 60 (decimal 96) or C4 (decimal 196).

DT1 (SMF date interpreted as Z'yyyymmdd'). A 4-byte SMF date value in the form P'cyyddd' (X'0cyydddF') is converted to a Z'yyyymmdd' value.
DT2 (SMF date interpreted as Z'yyyymm'). A 4-byte SMF date value in the form P'cyyddd' (X'0cyydddF') is converted to a Z'yyyymm' value.
DT3 (SMF date interpreted as Z'yyyyddd'). A 4-byte SMF date value in the form P'cyyddd' (X'0cyydddF') is converted to a Z'yyyyddd' value.
DC1 (TOD date interpreted as Z'yyyymmdd'). The 8 bytes of an input clock value, in the basic time-of-day (TOD) format, is converted to a Z'yyyymmdd' value. The STCKCONV macro is used to do the conversion.
DC2 (TOD date interpreted as Z'yyyymm'). The 8 bytes of an input clock value, in the basic time-of-day (TOD) format, is converted to a Z'yyyymm' value. The STCKCONV macro is used to do the conversion.
DC3 (TOD date interpreted as Z'yyyyddd'). The 8 bytes of an input clock value, in the basic time-of-day (TOD) format, is converted to a Z'yyyyddd' value. The STCKCONV macro is used to do the conversion.
DE1 (ETOD date interpreted as Z'yyyymmdd'). The first 8 bytes of an input clock value, in the extended time-of-day (ETOD) format, is converted to a Z'yyyymmdd' value. The STCKCONV macro is used to do the conversion.
DE2 (ETOD date interpreted as Z'yyyymm'). The first 8 bytes of an input clock value, in the extended time-of-day (ETOD) format is converted to a Z'yyyymm' value. The STCKCONV macro is used to do the conversion.
DE3 (ETOD date interpreted as Z'yyyyddd'). The first 8 bytes of an input clock value, in the extended time-of-day (ETOD) format is converted to a Z'yyyyddd' value. The STCKCONV macro is used to do the conversion.

In the time formats below, unless specified otherwise, hh represents the hour (00-23), mm represents the minutes (00-59), ss represents the seconds (00-59), and xx represents hundredths of a second (00-99).

In the time formats below, unless specified otherwise, hh represents the hour (00-23), mm represents the minutes (00-59), ss represents the seconds (00-59), and xx represents hundredths of a second (00-99).Format
Description
TM1 (SMF time interpreted as Z'hhmmss'). A 4-byte binary SMF time value in hundredths of a second is converted to a Z'hhmmss' value.
TM2 (SMF time interpreted as Z'hhmm'). A 4-byte binary SMF time value in hundredths of a second is converted to a Z'hhmm' value.
TM3 (SMF time interpreted as Z'hh'). A 4-byte binary SMF time value in hundredths of a second is converted to a Z'hh' value.
TM4 (SMF time interpreted as Z'hhmmssxx'). A 4-byte binary SMF time value in hundredths of a second is converted to a Z'hhmmssxx' value.
TC1 (TOD time interpreted as Z'hhmmss'). The 8 bytes of an input clock value, in the basic time-of-day (TOD) format, is converted to a Z'hhmmss' value. The STCKCONV macro is used to do the conversion.
TC2 (TOD time interpreted as Z'hhmm'). The 8 bytes of an input clock value, in the basic time-of-day (TOD) format, is converted to a Z'hhmm' value. The STCKCONV macro is used to do the conversion.
TC3 (TOD time interpreted as Z'hh'). The 8 bytes of an input clock value, in the basic time-of-day (TOD) format, is converted to a Z'hh' value. The STCKCONV macro is used to do the conversion.
TC4 (TOD time interpreted as Z'hhmmssxx'). The 8 bytes of an input clock value, in the basic time-of-day (TOD) format, is converted to a Z'hhmmssxx' value. The STCKCONV macro is used to do the conversion.
TE1 (ETOD time interpreted as Z'hhmmss'). The first 8 bytes of an input clock value, in the extended time-of-day (ETOD) format, is converted to a Z'hhmmss' value. The STCKCONV macro is used to do the conversion.
TE2 (ETOD time interpreted as Z'hhmm'). The first 8 bytes of an input clock value, in the extended time-of-day (ETOD) format, is converted to a Z'hhmm' value. The STCKCONV macro is used to do the conversion.
TE3 (ETOD time interpreted as Z'hh'). The first 8 bytes of an input clock value, in the extended time-of-day (ETOD) format, is converted to a Z'hh' value. The STCKCONV macro is used to do the conversion.
TE4 (ETOD time interpreted as Z'hhmmssxx'). The first 8 bytes of an input clock value, in the extended time-of-day (ETOD) format, is converted to a Z'hhmmssxx' value. The STCKCONV macro is used to do the conversion.
1
The overpunch sign bit is always 'C' for positive and 'D' for negative.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014