Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Eliminating dups using SORT and ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Eliminating dups using SORT and ICETOOL
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 Moderator


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

PostPosted: Wed Jan 04, 2006 9:34 pm    Post subject:
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    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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us