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

Eliminating dups using SORT and ICETOOL


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

New User


Joined: 15 Sep 2005
Posts: 17

PostPosted: Wed Jan 04, 2006 2:56 pm
Reply with quote

Hi,

My requirement is to remove duplicates from the input records and select only specific fields from the input rec to output rec.

When i used ICETOOL with SUM FIELDS = NONE, the duplicates weren't removed. When i used the same control card using SORT, it worked.

Can anyone explain why i was not able to remove the duplicates using ICETOOL.

I have given the JCL that i used for reference.

Using ICETOOL,

Code:

//STEP001 EXEC PGM=ICETOOL                       
//TOOLMSG DD SYSOUT=*                             
//DFSMSG  DD SYSOUT=*                             
//TOOLIN  DD *                                   
  COPY FROM(INDD) TO(OUTDD) USING(CTR1)           
/*                                               
//INDD DD *                                       
12345ABCDEFGHIJKL67890MNOPQRST                   
12345ABCDEFGHIJKL67890MNOPQRST                   
/*                                               
//OUTDD DD SYSOUT=*                               
//CTR1CNTL DD *                                   
  SORT FIELDS=(6,2,CH,A)                         
  SUM FIELDS=NONE                                 
  OUTREC FIELDS=(1:4Z,5:6,4,5X,14:6,4)           
/*     
The output is                                         

    ABCD     ABCD
    ABCD     ABCD



Using SORT,

Code:

//STEP001 EXEC PGM=SORT                     
//SORTIN DD *                               
12345ABCDEFGHIJKL67890MNOPQRST             
12345ABCDEFGHIJKL67890MNOPQRST             
/*                                         
//SORTOUT DD SYSOUT=*                       
//SYSOUT DD SYSOUT=*                       
//SYSPRINT DD SYSOUT=*                     
//SYSIN DD *                               
  SORT FIELDS=(6,2,CH,A)                   
  SUM FIELDS=NONE                           
  OUTREC FIELDS=(1:4Z,5:6,4,5X,14:6,4)     
/*                                         

The output is

    ABCD     ABCD



Thanks in Advance.

Regards,
Meena.
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 Jan 04, 2006 9:34 pm
Reply with quote

When I run your jobs with DFSORT, I get the same result for both cases (one record).

You're using a COPY operator with a SORT statement instead of a SORT operator with a SORT statement. In older versions of DFSORT, this would result in a COPY (SUM FIELDS=NONE has no meaning for a COPY since there's no key). In newer versions, it results in a SORT. So you're either using an older version of DFSORT or another product. Change your ICETOOL statement to:

SORT FROM(INDD) TO(OUTDD) USING(CTR1)

and you will get a SORT rather than a COPY.

By the way, here's another way to do this with DFSORT/ICETOOL:

Code:

//STEP003 EXEC PGM=ICETOOL                             
//TOOLMSG DD SYSOUT=*                                   
//DFSMSG  DD SYSOUT=*                                   
//TOOLIN  DD *                                         
SELECT FROM(INDD) TO(OUTDD) ON(6,2,CH) FIRST -       
    USING(CTR1)                                         
/*                                                     
//INDD DD *                                             
12345ABCDEFGHIJKL67890MNOPQRST                         
12345ABCDEFGHIJKL67890MNOPQRST                         
/*                                                     
//OUTDD DD SYSOUT=*                                     
//CTR1CNTL DD *                                         
   OUTFIL FNAMES=OUTDD,OUTREC=(1:4Z,5:6,4,5X,14:6,4)     
/*                                                     
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 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 JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Shift left VB record without x00 endi... DFSORT/ICETOOL 11
Search our Forums:

Back to Top