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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm


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