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
 

 

Remove the duplicates and store it in other dataset

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Remove the duplicates and store it in other dataset
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: 1452
Location: Chicago, IL

PostPosted: Wed Mar 29, 2006 12:37 pm    Post subject: Re: Duplicates
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    Post subject: Re: Duplicates
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: 1452
Location: Chicago, IL

PostPosted: Wed Mar 29, 2006 1:04 pm    Post subject: Re: Duplicates
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    Post subject: Re: Duplicates
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: 1452
Location: Chicago, IL

PostPosted: Wed Mar 29, 2006 1:14 pm    Post subject: Re: Duplicates
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: 26
Location: Chennai

PostPosted: Fri Apr 06, 2007 12:29 pm    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Fri Apr 06, 2007 1:58 pm    Post subject:
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: 26
Location: Chennai

PostPosted: Fri Apr 06, 2007 2:33 pm    Post subject:
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    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 Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


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