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
 

 

Need to copy the records without duplicates.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need to copy the records without duplicates.
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    Post subject: Reply to: Need to copy the records without duplicates.
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 7 Thu Apr 27, 2017 1:15 am
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am
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


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