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

Multiple sort outputs with different sort fields


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

New User


Joined: 09 Aug 2006
Posts: 24

PostPosted: Thu Dec 27, 2007 11:50 am
Reply with quote

Is it possible to have multiple sorted output files with different sort fields using a single sort card? The input file is same.

Scenario: I have an input file. I want 3 sorted output files. The first output file sorted based on based fields (1,20) second to be sorted based on (21,20) and third to be sorted based on (41,20). Is it possible to do using a single sort card?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Dec 27, 2007 12:40 pm
Reply with quote

You require three seperate SORT cards for your requirement
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: Thu Dec 27, 2007 10:19 pm
Reply with quote

Quote:
Is it possible to have multiple sorted output files with different sort fields using a single sort card? The input file is same.


No. You need one pass for each sort with different fields. You could use a DFSORT/ICETOOL job like the following with three SORT operators and three different SORT statements to do it in one step, but you'd still need three passes.

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=(1,20,CH,A)
/*
//CTL2CNTL DD *
  SORT FIELDS=(21,20,CH,A)
/*
//CTL3CNTL DD *
  SORT FIELDS=(41,20,CH,A)
/*
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 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Multiple table unload using INZUTILB DB2 2
Search our Forums:

Back to Top