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

Single sort condition and multiple i/p and o/p files.


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

New User


Joined: 23 Dec 2006
Posts: 10
Location: SYDNEY

PostPosted: Wed Jul 18, 2007 4:54 pm
Reply with quote

I have 4 input datasets(A,B,C and D) and i want to sort all with same sort condition to get sorted files (a,b,c and D). Can anyone tell me how it can be done by avoiding 4 different sort steps?
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Wed Jul 18, 2007 5:30 pm
Reply with quote

Anil,
Have u heard about data set concatination and you can also use the sort dd names like SORTIN01,02,03 and 04


Thamilzan.
Back to top
View user's profile Send private message
bvanilkumar

New User


Joined: 23 Dec 2006
Posts: 10
Location: SYDNEY

PostPosted: Wed Jul 18, 2007 5:44 pm
Reply with quote

Hi Thamilzan,
I dont want to concatinate all the datasets. I want to have individual sorted files for all the four. The sort condition being the same. If possible, please explain with example.
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: Wed Jul 18, 2007 8:01 pm
Reply with quote

The only way you could sort four different input files to four different output files with one sort pass would be if there is some way to separate the output records into the four output files:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file1
//  DD DSN=...  input file2
//  DD DSN=...  input file3
//  DD DSN=...  input file4
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file2
//OUT3 DD DSN=...  output file3
//OUT4 DD DSN=...  output file4
//SYSIN DD *
   SORT FIELDS=(...)
   OUTFIL FNAMES=OUT1,INCLUDE=(cond1)
   OUTFIL FNAMES=OUT2,INCLUDE=(cond2)
   OUTFIL FNAMES=OUT3,INCLUDE=(cond3)
   OUTFIL FNAMES=OUT4,INCLUDE=(cond4)
/*
Back to top
View user's profile Send private message
IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Wed Jul 18, 2007 8:09 pm
Reply with quote

Just out of interest , do you mean

without four different SORT steps ie in one sort pass as Frank describes
or
without four different JOB steps ie each file sorted but all done in the one jobstep
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jul 19, 2007 1:02 am
Reply with quote

Hello,

Does this "requirement" exist in an effort to reduce the number of steps that need to be documented for promotion to production?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jul 19, 2007 2:41 am
Reply with quote

Frank Yaeger wrote:
The only way you could sort four different input files to four different output files with one sort pass would be if there is some way to separate the output records into the four output files
If each file had a unique header record, could that uniqueness be propagated through the rest of the records to produce the field needed to separate them?
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 Jul 19, 2007 3:20 am
Reply with quote

Well, yes, but I'm guessing that propagating the header would require as many or more passes as doing the four separate sorts.

Going back to the original post, I'm now wondering if bvanilkumar really just wants one step for the four sorts as IQofaGerbil suggested rather than one pass. That, of course, could be done with one DFSORT/ICETOOL step and four SORT operators like this:

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN1 DD DSN=...  input file1
//IN2 DD DSN=...  input file2
//IN3 DD DSN=...  input file3
//IN4 DD DSN=...  input file4
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file2
//OUT3 DD DSN=...  output file3
//OUT4 DD DSN=...  output file4
//TOOLIN   DD    *
SORT FROM(IN1) TO(OUT1) USING(CTL1)
SORT FROM(IN2) TO(OUT2) USING(CTL1)
SORT FROM(IN3) TO(OUT3) USING(CTL1)
SORT FROM(IN4) TO(OUT4) USING(CTL1)
/*
//CTL1CNTL DD *
  SORT FIELDS=(...)
/*
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Thu Jul 19, 2007 3:30 am
Reply with quote

Frank,
Elegant!
Bill
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
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
Search our Forums:

Back to Top