IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Sort a file based on different keys in a single step


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nallapureddy

New User


Joined: 27 Jul 2005
Posts: 18

PostPosted: Mon Feb 25, 2008 12:24 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Feb 25, 2008 10:03 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Feb 26, 2008 2:10 am
Reply with quote

nallapureddy,

Are you a DFSORT customer (ICExxxs messages) or a Syncsort customer (WERxxxs messages)?
Back to top
View user's profile Send private message
nallapureddy

New User


Joined: 27 Jul 2005
Posts: 18

PostPosted: Tue Mar 04, 2008 6:03 pm
Reply with quote

I am a DFSORT customer
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Mar 04, 2008 9:26 pm
Reply with quote

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 icon_smile.gif

FWIW. . .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top