Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Remove duplicate records while sorting a file in JCL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Johore

Specialist


Joined: 12 Sep 2003
Posts: 19

PostPosted: Thu Sep 25, 2003 9:44 am    Post subject: Remove duplicate records while sorting a file in JCL
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    Post subject: Sorting without duplicates
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    Post subject:
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 Moderator


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

PostPosted: Tue Sep 19, 2006 8:43 pm    Post subject:
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:

http://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    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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 6 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us