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


SUM statement notes

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

  • If overflow might occur during summation, INREC can be used to create a larger SUM field in the reformatted input record (perhaps resulting in a larger record for sorting or merging) so that overflow does not occur. Example 5 illustrates this technique.
  • An invalid PD or ZD sign or digit results in a data exception (0C7 ABEND); 0-9 are invalid for the sign and A-F are invalid for the digit. For example, a ZD value such as 3.5 (X'F34BF5') results in an 0C7 because "." (X'4B') is treated as an invalid digit. ICETOOL's DISPLAY or VERIFY operator can be used to identify decimal values with invalid digits. ICETOOL's VERIFY operator can be used to identify decimal values with invalid signs.
  • Whether or not positive summed ZD results have printable numbers depends on whether NZDPRINT or ZDPRINT is in effect (as set by the ZDPRINT installation option and the NZDPRINT and ZDPRINT parameters of the OPTION statement):
    • If NZDPRINT is in effect, positive summed ZD results do not consist of printable numbers, regardless of whether the original values consisted of printable numbers or not. For example, if X'F2F3F1' (prints as '231') and X'F3F0F6' (prints as '306') are summed, the result with NZDPRINT in effect is X'F5F3C7' (prints as '53G').
    • If ZDPRINT is in effect, positive summed ZD results consist of printable numbers, regardless of whether the original values consisted of printable numbers or not. For example, if X'F2F3C1' (prints as '23A') and X'F3F0F6' (prints as '306') are summed, the result with ZDPRINT in effect is X'F5F3F7' (prints as '537').

    Thus, ZDPRINT must be in effect to ensure that positive summed ZD results are printable.

    Unsummed positive ZD values retain their original signs, regardless of whether NZDPRINT or ZDPRINT is in effect. For example, if X'F2F8C5' is not summed, it remains X'F2F8C5' (prints as '28E'). OUTFIL's OUTREC parameter can be used to ensure that all summed or unsummed ZD values are printable, as illustrated by Example 4 later in this section.

  • If input records are reformatted by INREC or E15, SUM must refer to fields in the appropriate reformatted record (see the preceding description of p).
  • Summary fields must not be control fields. They must not overlap control fields, or each other, and must not overlap the RDW.
  • FL (hexadecimal floating-point) values to be summed can be normalized or unnormalized. However, the resulting FL values are always normalized. Normalization processing by the hardware can produce different sums for FL values summed in different orders.
  • Exponent overflow for summed FL values results in an exponent overflow exception (0CC ABEND)
  • Exponent underflow for summed FL values results in a true zero result.
  • When records are summed, you can predict which record is to receive the sum (and be retained) and which record is to be deleted only when EQUALS is in effect, overflow does not occur, and the BLOCKSET technique is used. In this case, the first record (based on the sequence described under the discussion of the EQUALS or NOEQUALS parameter of the OPTION control statement) is chosen to contain the sum.

    Fields other than summary fields remain unchanged and are taken from the record that receives the sum.

  • You can control the action that DFSORT takes when overflow occurs for BI, FI, PD or ZD values with the OVFLO parameter as described in OPTION control statement.
  • DFSORT issues a message and terminates processing if a SUM statement is specified for a tape work data set sort or Conventional merge.
  • DFSORT does not support the XSUM parameter provided by a competitive sort product to write records deleted by SUM processing to a SORTXSUM DD data set. However, ICETOOL's SELECT operator can perform the same function as XSUM with FIELDS=NONE. For example, this ICETOOL job:
    //S1EXEC PGM=ICETOOL
    //TOOLMSG DD SYSOUT=*
    //DFSMSG DD SYSOUT=*
    //SORTIN DD DSN=...
    //SORTOUT DD DSN=...
    //SORTXSUM DD DSN=...
    //TOOLIN DD *
    SELECT FROM(SORTIN) TO(SORTOUT)-
      ON(5,4,CH) FIRST DISCARD(SORTXSUM)
    /*
    is equivalent to this XSUM job:
    //S1 EXEC PGM=ICEMAN
    //SYSOUT DD SYSOUT=*
    //SORTIN DD DSN=...
    //SORTOUT DD DSN=...
    //SORTXSUM DD DSN=...
    //SYSIN DD *
      SORT FIELDS=(5,4,CH,A)
      SUM FIELDS=NONE,XSUM
    /*
    Tip: You can also perform additional functions with ICETOOL's SELECT operator that are not available with XSUM. See Using ICETOOL for complete details of ICETOOL's SELECT operator.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014