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

Remove duplicate records while sorting a file in JCL


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

Specialist


Joined: 12 Sep 2003
Posts: 19

PostPosted: Thu Sep 25, 2003 9:44 am
Reply with quote

Dear Friends

I would like to know how I can remove duplicate records while sorting a file in JCL .

I have come accross SUM FIELDS = NONE option .IS this the only way.

Thanks in advance ,

Johore icon_smile.gif
Back to top
View user's profile Send private message
abdul

EXPERT


Joined: 28 Jul 2003
Posts: 23
Location: Bangalore,India

PostPosted: Sun Oct 05, 2003 3:49 pm
Reply with quote

Hi,

You can use SORT FIELDS=NONE for removeing duplicates in SORT. This is the easiest way to remove duplicates in a file. Could you pls explain the requirement that you have. Based on that I can give you some more methods to do the same.

Thanks
abdul
Back to top
View user's profile Send private message
jayant_tibhe

New User


Joined: 25 Feb 2006
Posts: 27
Location: Pune

PostPosted: Tue Sep 19, 2006 5:48 pm
Reply with quote

Hi Johor,

You don't have to code all the fields in your sort card. You can either use CH or BI as the SORT format, for all fields.

U can USe the Code..

SORT FIELDS=(1,4043,BI,A)

OR

SORT FIELDS=(1,4043,CH,A)
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: Tue Sep 19, 2006 8:43 pm
Reply with quote

Quote:
I would like to know how I can remove duplicate records while sorting a file in JCL .

I have come accross SUM FIELDS = NONE option .IS this the only way.


You can also use the SELECT operator of DFSORT's ICETOOL to remove duplicates like this:

Code:

//S1 EXEC PGM=ICETOOL                               
//TOOLMSG DD SYSOUT=*                               
//DFSMSG DD SYSOUT=*                               
//IN DD DSN=...  input file
//OUT DD DSN=...  output file                           
//TOOLIN DD *                                       
SELECT FROM(IN) TO(OUT) ON(p,m,f) FIRST
/*       


where p,m,f describes the key you want to check for duplicates on. p is the starting position, m is the length and f is the format.

I would argue that SELECT is the easiest way to remove duplicates. In addition, SELECT gives you a lot more ways to deal with duplicates than SUM FIELDS=NONE does. Besides FIRST, you can use LAST, FIRSTDUP, LASTDUP, ALLDUPS, NODUPS, HIGHER(n), LOWER(n) and EQUALS(n). SUM FIELDS=NONE only does the FIRST function.

For complete details on the SELECT operator of DFSORT's ICETOOL, see:

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.11?DT=20060615185603
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top