Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Single sort condition and multiple i/p and o/p files.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Single sort condition and multiple i/p and o/p files.
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Wed Jul 18, 2007 8:01 pm    Post subject:
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    Post subject: Re: Single sort condition and multiple i/p and o/p files.
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

Site Director


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

PostPosted: Thu Jul 19, 2007 1:02 am    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Jul 19, 2007 2:41 am    Post subject:
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 Moderator


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

PostPosted: Thu Jul 19, 2007 3:20 am    Post subject:
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: 3158
Location: Tucson AZ

PostPosted: Thu Jul 19, 2007 3:30 am    Post subject:
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    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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 5 Thu Nov 23, 2017 3:32 pm
No new posts Compare VSAM files using DFSORT pshongal DFSORT/ICETOOL 5 Thu Nov 23, 2017 10:24 am
No new posts Split files upto certain limit based ... bubbu75 DFSORT/ICETOOL 5 Tue Nov 14, 2017 11:11 pm
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us