View previous topic :: View next topic
|
Author |
Message |
bvanilkumar
New User
Joined: 23 Dec 2006 Posts: 10 Location: SYDNEY
|
|
|
|
I have 4 input datasets(A,B,C and D) and i want to sort all with same sort condition to get sorted files (a,b,c and D). Can anyone tell me how it can be done by avoiding 4 different sort steps? |
|
Back to top |
|
|
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
Anil,
Have u heard about data set concatination and you can also use the sort dd names like SORTIN01,02,03 and 04
Thamilzan. |
|
Back to top |
|
|
bvanilkumar
New User
Joined: 23 Dec 2006 Posts: 10 Location: SYDNEY
|
|
|
|
Hi Thamilzan,
I dont want to concatinate all the datasets. I want to have individual sorted files for all the four. The sort condition being the same. If possible, please explain with example. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The only way you could sort four different input files to four different output files with one sort pass would be if there is some way to separate the output records into the four output files:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file1
// DD DSN=... input file2
// DD DSN=... input file3
// DD DSN=... input file4
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//OUT3 DD DSN=... output file3
//OUT4 DD DSN=... output file4
//SYSIN DD *
SORT FIELDS=(...)
OUTFIL FNAMES=OUT1,INCLUDE=(cond1)
OUTFIL FNAMES=OUT2,INCLUDE=(cond2)
OUTFIL FNAMES=OUT3,INCLUDE=(cond3)
OUTFIL FNAMES=OUT4,INCLUDE=(cond4)
/*
|
|
|
Back to top |
|
|
IQofaGerbil
Active User
Joined: 05 May 2006 Posts: 183 Location: Scotland
|
|
|
|
Just out of interest , do you mean
without four different SORT steps ie in one sort pass as Frank describes
or
without four different JOB steps ie each file sorted but all done in the one jobstep |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Does this "requirement" exist in an effort to reduce the number of steps that need to be documented for promotion to production? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Frank Yaeger wrote: |
The only way you could sort four different input files to four different output files with one sort pass would be if there is some way to separate the output records into the four output files |
If each file had a unique header record, could that uniqueness be propagated through the rest of the records to produce the field needed to separate them? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Well, yes, but I'm guessing that propagating the header would require as many or more passes as doing the four separate sorts.
Going back to the original post, I'm now wondering if bvanilkumar really just wants one step for the four sorts as IQofaGerbil suggested rather than one pass. That, of course, could be done with one DFSORT/ICETOOL step and four SORT operators like this:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=... input file1
//IN2 DD DSN=... input file2
//IN3 DD DSN=... input file3
//IN4 DD DSN=... input file4
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//OUT3 DD DSN=... output file3
//OUT4 DD DSN=... output file4
//TOOLIN DD *
SORT FROM(IN1) TO(OUT1) USING(CTL1)
SORT FROM(IN2) TO(OUT2) USING(CTL1)
SORT FROM(IN3) TO(OUT3) USING(CTL1)
SORT FROM(IN4) TO(OUT4) USING(CTL1)
/*
//CTL1CNTL DD *
SORT FIELDS=(...)
/*
|
|
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
Frank,
Elegant!
Bill |
|
Back to top |
|
|
|