View previous topic :: View next topic
|
Author |
Message |
aprak00 Warnings : 2 New User
Joined: 09 Aug 2006 Posts: 24
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
You require three seperate SORT cards for your requirement |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|