SORT and split files on condition.



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

SORT and split files on condition.

Postby shankar_at » Tue Mar 05, 2013 12:25 am

Hello,

I did not find exact matching post in this forum, so posting my question (sorry if similar post is hiding somewher).

I want to sort a file into multiple files in the SAME SYSIN DD *, each is based on differnet sort condition.

example, (SORT FIELDS = (1,3,CH,A) ===== want result in file 1
(SORT FIELDS = (5,9,CH,A) ===== want result in file 2
(SORT FIELDS = (15,5,CH,A) ==== " in file 3

I have tried couple of options thru google search, but its not working. I can do this in 3 simple steps but just wanted to know if there is any way to do it in single step.

Can someone help me on this.
shankar_at
 
Posts: 2
Joined: Thu Feb 21, 2013 9:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SORT and split files on condition.

Postby skolusu » Tue Mar 05, 2013 2:56 am

shankar_at wrote:Hello,

I did not find exact matching post in this forum, so posting my question (sorry if similar post is hiding somewher).

I want to sort a file into multiple files in the SAME SYSIN DD *, each is based on differnet sort condition.

example, (SORT FIELDS = (1,3,CH,A) ===== want result in file 1
(SORT FIELDS = (5,9,CH,A) ===== want result in file 2
(SORT FIELDS = (15,5,CH,A) ==== " in file 3

I have tried couple of options thru google search, but its not working. I can do this in 3 simple steps but just wanted to know if there is any way to do it in single step.

Can someone help me on this.


I never understood this fascination for a single step. You cannot have 3 different sort on a single pass of data. However you can code a single ICETOOL step which does 3 passes of data (quite similar to 3 steps) and get you the desired results. What exactly is the problem with 3 steps?
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: SORT and split files on condition.

Postby shankar_at » Tue Mar 05, 2013 3:42 am

hello,
There is no problem with 3 steps, just was curius to know if there is any sort card which does in single step.. Looks like we cannot do in single step..
thanks for the reply...
shankar_at
 
Posts: 2
Joined: Thu Feb 21, 2013 9:30 pm
Has thanked: 0 time
Been thanked: 0 time

Re: SORT and split files on condition.

Postby enrico-sorichetti » Tue Mar 05, 2013 3:45 am

what counts from an overall performance point of view
is not the number of steps, but the number of passes over the input data
since the SORT is done over 3 different fields, 3 passes are needed.
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3003
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: SORT and split files on condition.

Postby skolusu » Tue Mar 05, 2013 3:54 am

shankar_at wrote:hello,
There is no problem with 3 steps, just was curius to know if there is any sort card which does in single step.. Looks like we cannot do in single step..
thanks for the reply...


I guess you haven't read my reply properly. Yes you can do in single step but that would involve 3 passes of data. Performance wise it is quite similar to coding 3 different steps. Here is a single step JCL which will do 3 different sorts.


//STEP0100 EXEC PGM=ICETOOL         
//TOOLMSG  DD SYSOUT=*               
//DFSMSG   DD SYSOUT=*               
//IN       DD *                     
----+----1----+----2----+----3----+--
ZZZ 111111111 GGGGG                 
AAA 555555555 HHHHH                 
DDD 333333333 FFFFF                 
//OUT1     DD SYSOUT=*               
//OUT2     DD SYSOUT=*               
//OUT3     DD SYSOUT=*               
//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,3,CH,A)             
//*                                 
//CTL2CNTL DD *                     
  SORT FIELDS=(5,9,CH,A)             
//*                                 
//CTL3CNTL DD *                     
  SORT FIELDS=(15,5,CH,A)           
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post