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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


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