Page 1 of 1

Multiple Input File for Sort

PostPosted: Wed Feb 24, 2010 4:46 am
by sambaugh
I am trying to use ICETOOL to put a series of JOINS and SORTS together as one step in a job. At the end, I would like to combine 4 files into 1, but as far as I can tell, there is no way to identify multiple files on the SORT FROM(dd). Thanks!

Re: Multiple Input File for Sort

PostPosted: Wed Feb 24, 2010 5:25 am
by dick scherrer
Hello and welcome to the forum,

What is the definition of "combine" in this situation?

If the 4 files are "compatible", you might add simply concatenate them as input to a copy/sort.

If this will not do what you want you need to post complete details of what you are trying to do, the recfm and lrecls of all of the files and the "processing rules". Show a bit of sample input and the output you want from that input.

Re: Multiple Input File for Sort

PostPosted: Wed Feb 24, 2010 9:04 pm
by sambaugh
Thanks for your response. I was able to do what I needed by writing (appending) each file to a single dataset and then doing the sort, so I was looking for MERGE functionality.

My goal is to take a job with several (SORT & JOIN) steps and combine these steps into a single ICETOOL step (with several control card sets), and it now looks promising that I will be able to do this. In the usual method of sorting, I did have the 4 files concatenated on the SORTIN dd and just wanted to replicate this in ICETOOL.

Re: Multiple Input File for Sort

PostPosted: Wed Feb 24, 2010 10:16 pm
by skolusu
sambaugh,

With z/OS DFSORT V1R5 PTF UK51706 or z/OS DFSORT V1R10 PTF UK51707 (Nov, 2009), DFSORT now supports MERGE operations in ICETOOL that allows you to merge up to 50 input data sets that are already in order by the same keys. Various options of MERGE allow you to define the ddnames for the input and output data sets and the MERGE and other DFSORT control statements to be used for the MERGE operation.

As an example, you could use the following ICETOOL step to merge four input data sets to a single output data set.

//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//IN1      DD DSN=MY.INPUT1,DISP=SHR
//IN2      DD DSN=MY.INPUT2,DISP=SHR
//IN3      DD DSN=MY.INPUT3,DISP=SHR
//IN4      DD DSN=MY.INPUT4,DISP=SHR
//OUT      DD DSN=MY.OUTPUT1,DISP=(NEW,CATLG,DELETE),
//            UNIT=SYSDA,SPACE=(CYL,(5,5))
//TOOLIN DD *
  MERGE FROM(IN1,IN2,IN3,IN4) TO(OUT) USING(CTL1)
//CTL1CNTL DD *
  MERGE FIELDS=(11,8,ZD,A)
//*


For complete details on date conversion functions and the other new functions available with the Nov, 2009 DFSORT PTF, see:

http://www.ibm.com/support/docview.wss? ... g3T7000174