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
 

 

Can't we eliminate the duplicate records while copying.

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

Active User


Joined: 13 Sep 2006
Posts: 200
Location: USA

PostPosted: Wed Apr 09, 2008 12:59 pm    Post subject: Can't we eliminate the duplicate records while copying.
Reply with quote

Hi All,

I am just copying the records from an input dataset to an output dataset which will meet some criteria.But while copying I want to eliminate duplicates.I have added SUM FIELDS=NONE. But it is not working instead it is copying the record as many times as it exist in the input file.

SUM FIELDS=NONE will work only for SORT process. Then please tell me how to eliminate the duplicates while copying.

Regards
Amar
Back to top
View user's profile Send private message

V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 200
Location: USA

PostPosted: Wed Apr 09, 2008 1:00 pm    Post subject: Reply to: Can't we eliminate the duplicate records while cop
Reply with quote

My code is as follows
Code:

OPTION COPY                                           
INCLUDE  COND=(3,7,CH,EQ,C' BEGIN ',OR,(1,1,CH,EQ,     
               C'*',AND,11,2,CH,EQ,C' *'))             
SUM FIELDS=NONE                                       
INREC IFOUTLEN=160,                                   
IFTHEN=(WHEN=(3,7,CH,EQ,C' BEGIN '),                   
  BUILD=(10,7)),                                       
IFTHEN=(WHEN=(1,1,CH,EQ,C'*',AND,11,2,CH,EQ,C' *'),   
  BUILD=(2,3,                                         
         5:C'Model do not follow the correct syntax.'))
Back to top
View user's profile Send private message
rajatbagga

Active User


Joined: 11 Mar 2007
Posts: 193
Location: india

PostPosted: Wed Apr 09, 2008 1:32 pm    Post subject:
Reply with quote

Hello V S Amarendra Reddy,

You can try this below card where :

p=position of the field that you want to check for duplicates in the record
l=lenght of that field
t=type of that field for ex.CH ,ZD or PD.

You can have more then one ON conditions:

Code:
//TOOLIN DD *
SELECT FROM(input file) TO(output file) ON(p,l,t) NODUPS
/*


If this doesnt work out then let us the position and length of the fields in the record for which you want to check the duplicate condition.

Regards,
Rajat
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 200
Location: USA

PostPosted: Wed Apr 09, 2008 1:44 pm    Post subject:
Reply with quote

Hi Rajat,

Thanks for the reply. Thing is my whole function is working properly with DFSORT except the duplicates are coming out in the output dataset. I think your suggestion uses the ICETOOL. Now for duplicates alone If I change the sort to SYNCSORT then I need to implement the whole functionality(Formatting of records) in ICETOOL again.I am not that aware of SYNCSORT as DFSORT.

Can you please let me know is there any possibility to implement it in DFSORT.

Regards
Amar
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10254
Location: italy

PostPosted: Wed Apr 09, 2008 2:46 pm    Post subject: Reply to: Can't we eliminate the duplicate records while cop
Reply with quote

how in heaven can You expect to eliminate duplicates without sorting ??
any process trying to eliminate duplicates will expect to have them contiguous
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 200
Location: USA

PostPosted: Wed Apr 09, 2008 2:51 pm    Post subject:
Reply with quote

Hello,

I added sort also like this even then it was not working.

Code:
OPTION COPY                                           
INCLUDE  COND=(3,7,CH,EQ,C' BEGIN ',OR,(1,1,CH,EQ,     
               C'*',AND,11,2,CH,EQ,C' *'))             
SORT FIELDS=(2,3,CH,A)                                 
SUM FIELDS=NONE                                       
INREC IFOUTLEN=160,                                   
IFTHEN=(WHEN=(3,7,CH,EQ,C' BEGIN '),                   
  BUILD=(10,7)),                                       
IFTHEN=(WHEN=(1,1,CH,EQ,C'*',AND,11,2,CH,EQ,C' *'),   
  BUILD=(2,3,                                         
         5:C'Model do not follow the correct syntax.'))



Please check if if there are any mistakes in the above code.

Regards
Amar
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: Wed Apr 09, 2008 8:34 pm    Post subject:
Reply with quote

SUM FIELDS=NONE can only be used with SORT or MERGE, not with COPY. That's because eliminating duplicates requires a "key" to define the duplicates. If your records are already in sorted order, you can use MERGE rather than SORT with SUM FIELDS=NONE. MERGE is generally more efficient than SORT. If your records are not in sorted order, then you need to use SORT with SUM FIELDS=NONE.

Quote:
Please check if if there are any mistakes in the above code.


The OPTION COPY statement overrides the SORT statement so you are still doing a COPY, not a SORT. Remove OPTION COPY. DFSORT message ICE143I tells you if you are doing a COPY, SORT or MERGE.

Note also that your INREC reformatting will be performed before SORT and SUM so the SORT statement will operate on the reformatted records. I'm not sure if that's what you wanted or not. If you want to reformat after sorting, use an OUTREC statement rather than an INREC statement.
Back to top
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 200
Location: USA

PostPosted: Wed Apr 09, 2008 8:50 pm    Post subject:
Reply with quote

Frank,

You are always there for my queries. Thanks Now I am clarified.


Regards
Amar
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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Copying Panvalet members to PDS LOGESHWARAN K CA Products 4 Mon Mar 06, 2017 10:45 am


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