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

Remove the duplicates and store it in other dataset


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

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Wed Mar 29, 2006 12:18 pm
Reply with quote

Hi,

I want to completely remove the duplicates and store it in other dataset.
By "completely remove' what I mean is
if suppose I have got 5 duplicates + 2 more diffrent record in my file A.
After running sort I should have 2 records ( which were previously there )
and rest all the 5 records should be moved to dataset B.

If you use XSUM then only 4 records will be moved to dataset B and one record ( out of 5 ) will still remain in dataset A.

Can we do this in sort??
If yes, then how??

Thanks
ap_mainframes
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Mar 29, 2006 12:37 pm
Reply with quote

What is LRECL & RECFM of the input file?

On what basis you want to compare duplicates ? i.e. fields ..starting from ..up to length...??

Regards,
Priyesh.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Wed Mar 29, 2006 12:51 pm
Reply with quote

LRECL IS 4100.
RECFM IS VB.

I tried using XSUM in that case my sort lloks like


//SYSIN DD *
SORT FIELDS=(8,12,ZD,A)
SUM FIELDS=NONE,XSUM
/*

I want to sum up based on position of 8 to length 12.

ap_mainframes
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Mar 29, 2006 1:04 pm
Reply with quote

ok, try this DFSORT job to make it.

Code:
//STEP1     EXEC PGM=ICETOOL                               
//TOOLMSG   DD SYSOUT=*                                   
//DFSMSG    DD SYSOUT=*                                   
//FILEA  DD DSN=HLQ.RECORDS.INPUT,DISP=SHR             
//OUT1   DD DSN=HLQ.RECORDS.OUTPUT1,DISP=(,KEEP,DELETE)
//OUT2   DD DSN=HLQ.RECORDS.OUTPUT2,DISP=(,KEEP,DELETE)
//TOOLIN DD *                                             
  SELECT FROM(FILEA) TO(OUT1) ON(12,12,ZD) NODUPS           
  SELECT FROM(FILEA) TO(OUT2) ON(12,12,ZD) ALLDUPS           
//*                                                       


Quote:
I want to sum up based on position of 8 to length 12.

I have assumed it as a key checking for duplicate.

Regards,
Priyesh.
Back to top
View user's profile Send private message
ap_mainframes

Active User


Joined: 29 Dec 2005
Posts: 181
Location: Canada

PostPosted: Wed Mar 29, 2006 1:10 pm
Reply with quote

Well unfortunately ICETOOL just doesnt work here.
Please suggest.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Wed Mar 29, 2006 1:14 pm
Reply with quote

Are you using SYNCSORT ?

Show some error messages after running this step.

Regards,
Priyesh.
Back to top
View user's profile Send private message
satheeshkamal

New User


Joined: 09 Jan 2007
Posts: 28
Location: Chennai

PostPosted: Fri Apr 06, 2007 12:29 pm
Reply with quote

Hi,

Since XSUM is not supported in DFSORT, is there any way other than using ICETOOL to store the duplicates in the input file to another file?

The requirement is this...

i/p:

aa
aa
bb
cc
dd
dd
ee


o/p:
aa
bb
cc
dd
ee

Duplicate file o/p:
aa
dd



i searched this whole forum, couldn't find to do this using normal SORT.
i don't have ICETOOL in my shop icon_sad.gif

i actually thought to raise this as a separate topic, but felt better to post this in this topic (as the topic perfectly matches) icon_smile.gif

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

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Fri Apr 06, 2007 1:58 pm
Reply with quote

Satheesh,

Quote:
i don't have ICETOOL in my shop

DFSORT supports ICETOOL and your shop has DFSORT, I believe this statement is meaning less.

Quote:
thought to raise this as a separate topic

Should have done that, instead of raising as a continuation to previous post.


Anyways here is the JCL you are looking for -

Code:
//STEPNAME  EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SORTIN DD *
AA
AA
BB
CC
DD
DD
EE
/*
//NODUPSS DD SYSOUT=*
//DUPSS    DD SYSOUT=*
//TOOLIN DD *
  SELECT FROM(SORTIN) TO(NODUPSS) FIRST DISCARD(DUPSS) ON(1,2,CH)
/*


OP as you expected.
Back to top
View user's profile Send private message
satheeshkamal

New User


Joined: 09 Jan 2007
Posts: 28
Location: Chennai

PostPosted: Fri Apr 06, 2007 2:33 pm
Reply with quote

Murali,

Thank you very much icon_biggrin.gif . it got worked! icon_lol.gif

i am very sorry, i didn't know that DFSORT includes ICEMAN, ICETOOL packages within itself as i am new to this. Sorry about that.


icon_razz.gif
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 Store the data for fixed length COBOL Programming 1
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top