Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Sort a file based on different keys in a single step

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Sort a file based on different keys in a single step
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 Moderator


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

PostPosted: Mon Feb 25, 2008 10:03 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Feb 26, 2008 2:10 am    Post subject:
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    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Tue Mar 04, 2008 9:26 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts SORT to unpack a feild shr_amar DFSORT/ICETOOL 7 Fri Jul 07, 2017 4:32 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us