Joined: 26 Apr 2004 Posts: 4650 Location: Raleigh, NC, USA
Standard system data management rules apply to all DFSORT data set processing. In particular, be aware that, in some cases, if a DD statement specifies a data set for output that is extended to a second or subsequent volume, and another DD statement within the same step requests the same data set, only the records on the first volume will be read, and incorrect output will result. Specifically, when a new output data set is allocated with a unit count and volume count greater than one, but specifies no volume serial numbers, one volume is allocated. If a second or succeeding DD statement within the same step requests the same data set, the same volume is allocated to it. If this job step extends the output data set to more volumes, this new volume information is not available to the second or succeeding DD statement. Thus, you should not use different DDs for a data set to be used for output and then input in the same step, unless the data set cannot be extended to a second or subsequent volume, or is allocated with the guaranteed space attribute in the storage class. See "z/OS MVS JCL Reference, SA22-7597" and z/OS DFSMS Using Data Sets, SC26-7410" for more details.