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

Need to copy the records without duplicates.


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

New User


Joined: 21 Dec 2005
Posts: 19

PostPosted: Mon Mar 10, 2008 8:38 pm
Reply with quote

Hi,

I just need to copy the records from input to output by removing
duplicates. I do not want the output file to be in sorted order.

I had used the following code:

SORT FIELDS=COPY
SUM FIELDS=NONE

but it didnt work, may be because I gave the "COPY" option first.

Example:

Input:

abcd
abcd
zzzz
zzzz
efgh
ijkl
aaaa
aaaa

Output:

abcd
zzzz
efgh
ijkl
aaaa

The length of actual field in the file is -10
Starting position -1

I guess its a very simple one.. but still can you please help me with this..?

Thanks,
Aditya.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Mar 10, 2008 9:03 pm
Reply with quote

Aditya_gora,

you can use the following control cards

Code:

//SYSIN   DD *
  SORT FIELDS=(01,10,CH,A)
  SUM FIELDS=NONE
/*


or you can use the following DFSORT/ICETOOL jcl which will give you the desired results
Code:

//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG  DD SYSOUT=*     
//DFSMSG   DD SYSOUT=*     
//IN       DD DSN=YOUR INPUT FILE,
//            DISP=SHR
//OUT      DD SYSOUT=*
//TOOLIN   DD *                                   
  SELECT FROM(IN) TO(OUT) ON(01,10,CH) FIRST
/*
Back to top
View user's profile Send private message
aditya_gorti

New User


Joined: 21 Dec 2005
Posts: 19

PostPosted: Mon Mar 10, 2008 9:09 pm
Reply with quote

I have tried both of these above but they are not working. I do not want the output to be in sorted order... just a copy of the input by removing the duplicates would do..
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Mar 10, 2008 9:20 pm
Reply with quote

If you want to retain the original order of records then you need another pass of data. try this

Code:

//STEP0100 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//IN       DD *                                           
ABCD                                                     
ABCD                                                     
ZZZZ                                                     
ZZZZ                                                     
EFGH                                                     
IJKL                                                     
AAAA                                                     
AAAA                                                     
//T1       DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT      DD SYSOUT=*                                   
//TOOLIN   DD *                                           
  SELECT FROM(IN) TO(T1) ON(01,10,CH) FIRST USING(CTL1)   
  SORT FROM(T1) TO(OUT) USING(CTL2)                       
//CTL1CNTL DD *                                           
 INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,PD))       
//CTL2CNTL DD *                                           
  SORT FIELDS=(81,8,PD,A)                                 
  OUTREC BUILD=(01,80)                                   
/*                                                       
Back to top
View user's profile Send private message
aditya_gorti

New User


Joined: 21 Dec 2005
Posts: 19

PostPosted: Mon Mar 10, 2008 10:29 pm
Reply with quote

Now it is working absolutely fine.. icon_smile.gif Thanks a lot!
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 Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top