View previous topic :: View next topic
|
Author |
Message |
nallapureddy
New User
Joined: 27 Jul 2005 Posts: 18
|
|
|
|
Could anyone tell me if there is any way to sort a input file based on different keys to produce different output files in a single step..
like if my input file has 3 fields like.. account number,cusip,dept,..etc..
is there any chance for me to produce three output files in a single sort step.. which are sorted in the following order..
i.e. sortof1 should be sorted by account number
sortof2 should b sorted by cusip
sortof3 should be sorted by dept.. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
It depends on whether you actually mean in "a single step" or in "a single pass". You cannot sort on different keys in a single pass over the data. You can sort on different keys in a single step using DFSORT's ICETOOL. Here's an example:
Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT1 DD DSN=... output file1
//OUT2 DD DSN=... output file2
//OUT3 DD DSN=... output file3
//TOOLIN DD *
SORT FROM(IN) TO(OUT1) USING(CTL1)
SORT FROM(IN) TO(OUT2) USING(CTL2)
SORT FROM(IN) TO(OUT3) USING(CTL3)
/*
//CTL1CNTL DD *
SORT FIELDS=(... sort by account number ...)
/*
//CTL2CNTL DD *
SORT FIELDS=(... sort by cusip ...)
/*
//CTL3CNTL DD *
SORT FIELDS=(... sort by dept ...)
/*
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
nallapureddy,
Are you a DFSORT customer (ICExxxs messages) or a Syncsort customer (WERxxxs messages)? |
|
Back to top |
|
|
nallapureddy
New User
Joined: 27 Jul 2005 Posts: 18
|
|
|
|
I am a DFSORT customer |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Is there some business reason to create 3 entire copies of the original input?
Please keep in mind that in my worlds, "regular" files have multiple hundred million records. One that came in yesterday is 6,300 cyls of dasd. If we were to try to create 3 "sorted" copies, the dasd people would be looking for us to do bodily harm
FWIW. . . |
|
Back to top |
|
|
|