Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Example 5 z/OS DFSORT Application Programming Guide SC23-6878-00 |
|
These statements illustrate a technique for preventing overflow of summed fields by using INREC to make the fields larger before they are summed. The fields that might overflow when they are summed are a 4 byte ZD field starting at position 11 and a 2 byte PD field starting at position 21. In order to prevent them from overflowing, we expand each field on the left with an appropriate zero byte; C'0' (Z'0') for the ZD field and P'0' (X'00') for the PD field. We can then sum on the new 5 byte ZD field and on the new 3 byte PD field. Note that adding these extra bytes increases the length of the record and changes the starting position of various fields. In the SORT and SUM statements, we must specify the starting positions of the fields in the reformatted record rather than the starting positions of the fields in the input record. For example, although the SORT field starts in position 23 in the input record, we must use its starting position of 25 in the reformatted record. |
Copyright IBM Corporation 1990, 2014
|