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

Removing duplicates without Sorting in JCL


IBM Mainframe Forums -> JCL & VSAM
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Mon Apr 16, 2012 11:59 am
Reply with quote

Hi,

yes, it selects the FIRST occurrence of duplicate records without sorting

ie. SORT FIELDS=COPY


Gerry
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Apr 16, 2012 12:02 pm
Reply with quote

Your file is not actually in "collating" sequence, strictly, as seen by the trailer moving its position.

Check whether select enjoys having a sorted file. If it does, test very carefully with Gerry's solution.

The problem with the way that you have applied my second solution is that you haven't specified the full extend of the record areas for matching.

With that one you have three record areas, all the same length, all as one record. You need to compare the second and third record areas, for the entire length of your record. I suspect you can only do this in 256-byte "chunks", hence my reference to 1,256 257,256 etc, where you have to offset the starting points for the two additional record areas.

So something likse 784,256,etc with each area matching against the third record area with AND joining each togeteher

a=a1,and,b=b1,and,c=c1,and,d=d1

where a,b,c,d are the chunks from the first extension (first PUSH) and a1,b1,c1,d1 are from the second.

EDIT: I see you are OK now.
Back to top
View user's profile Send private message
vishalbshah

New User


Joined: 01 Dec 2006
Posts: 61
Location: Pune

PostPosted: Mon Apr 16, 2012 12:07 pm
Reply with quote

Hi Gerry,

Where can I see different options of ICETOOL?

I mean the one which we used i.e. "FIRST" works fine for now...

I want to see which other options are available with this.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Apr 16, 2012 12:11 pm
Reply with quote

In your Syncsort documentation, of course.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Apr 16, 2012 11:32 pm
Reply with quote

Bill Woodger wrote:
In your Syncsort documentation, of course.


Or maybe you'd better contact Syncsort if you can't find it documented... let us know, please, how you get on.
Back to top
View user's profile Send private message
nagaraj_bez

New User


Joined: 09 Jun 2005
Posts: 10

PostPosted: Tue Apr 17, 2012 1:25 pm
Reply with quote

Hi Vishalbshah,

find below steps for removing duplicates(irrespective duplicate record position - contigious or not) with out sorting the file. Let me know the status once u tried this.

Used recod length as 80
&input = input file
&output2 = required output file

Code:
//COPY1  EXEC  PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN   DD  DSN=&INput ,
//             DISP=SHR
//SORTOUT  DD  DSN=&OUTPUT1,
//             DISP=(NEW,CATLG,DELETE),
//             RECFM=FB,LRECL=90,
//             SPACE=(TRK,(10,5),RLSE)
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 INREC OVERLAY=(81:SEQNUM,8,ZD)
 SORT FIELDS=COPY
sum fields = none
 OUTREC BUILD=(1:81,8,9:1,80)
/*
//COPY2  EXEC  PGM=SORT
//SORTIN   DD  DSN=&OUTPUT1,
//             DISP=SHR
//SORTOUT  DD  DSN=&OUTPUT2,
//             DISP=(NEW,CATLG,DELETE),
//             RECFM=FB,LRECL=99,
//             SPACE=(TRK,(10,5),RLSE)
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//SYSIN    DD  *
 SORT FIELDS=(1,8,CH,A)
 OUTREC BUILD=(1:1,89,X,91:SEQNUM,8,ZD,START=1,INCR=1,RESTART=(9,80))
/*
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Apr 17, 2012 1:38 pm
Reply with quote

TS already has a solution which actually runs and runs in only one step.

Did you test this two-step solution? What on earth were you expecting it to do, if it got through basic validation of control cards?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page Previous  1, 2

 


Similar Topics
Topic Forum Replies
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts Sorting Date Field DFSORT/ICETOOL 4
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts How to remove block of duplicates DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
Search our Forums:

Back to Top