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

How to Sort single input file to multiple sortout files


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

New User


Joined: 22 Nov 2006
Posts: 23
Location: Mumbai

PostPosted: Wed Jan 17, 2007 8:27 pm
Reply with quote

Hi,

I have a input file with 4 fields. I want 4 out files with different sort criteria. I.e first output file should sort on first field and second output should sort second field....etc.. in a single sort step.

Regards
-Narisimha
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: Wed Jan 17, 2007 10:20 pm
Reply with quote

Narismha,

You can't sort on different keys in one sort step, but you can do it in one DFSORT/ICETOOL step, although it will take 4 passes over the input file. 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
//OUT4 DD DSN=...  output file4
//TOOLIN DD *
SORT FROM(IN) TO(OUT1) USING(CTL1)
SORT FROM(IN) TO(OUT2) USING(CTL2)
SORT FROM(IN) TO(OUT3) USING(CTL3)
SORT FROM(IN) TO(OUT4) USING(CTL4)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,10,CH,A)
/*
//CTL2CNTL DD *
  SORT FIELDS=(11,10,CH,A)
/*
//CTL3CNTL DD *
  SORT FIELDS=(21,10,CH,A)
/*
//CTL4CNTL DD *
  SORT FIELDS=(31,10,CH,A)
/*
Back to top
View user's profile Send private message
Narismha

New User


Joined: 22 Nov 2006
Posts: 23
Location: Mumbai

PostPosted: Thu Jan 18, 2007 9:55 am
Reply with quote

Hi Frank Yaeger,

Thank you so much. Its working fine.

Regards
-Narisimha
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 How to split large record length file... DFSORT/ICETOOL 8
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
Search our Forums:

Back to Top