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
 

 

Multiple sort outputs with different sort fields

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Multiple sort outputs with different sort fields
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    Post subject:
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 Moderator


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

PostPosted: Thu Dec 27, 2007 10:19 pm    Post subject:
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    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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm


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