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
 

 

How to Sort single input file to multiple sortout files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to Sort single input file to multiple sortout files
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 Moderator


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

PostPosted: Wed Jan 17, 2007 10:20 pm    Post subject:
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    Post subject:
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    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
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 0 Thu Jul 27, 2017 9:16 pm
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm
No new posts Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
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


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