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
 

 

Group where data item A is different for dups on item B

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

New User


Joined: 20 Jan 2010
Posts: 5
Location: UK

PostPosted: Tue Jan 26, 2010 11:09 pm    Post subject: Group where data item A is different for dups on item B
Reply with quote

Hi,

If I have the follwing records in a file:

Field 1 Field 2

AAAAA 12345
AAAAB 12345
AAABB 12345
FFFFFF 55555
BBBBB 99999
BBBBB 99999

I want to output the duplicates on Field 2, but only where there are differences in Field 1. So, given the above example, my output will be:

AAAAA 12345
AAAAB 12345
AAABB 12345.

Notice even though feild 2 has dupliates of 99999, it is not output because in all records field 1 are identical.
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Jan 27, 2010 12:02 am    Post subject:
Reply with quote

What if there is repetition of AAAAA with second field as 12345
Can you please tell what should be output in below case?
Code:

AAAAA 12345
AAAAA 12345
AAAAA 12345
AAAAB 12345
AAABB 12345
FFFFFF 55555
BBBBB 99999
BBBBB 99999


What sort product do you use?
Back to top
View user's profile Send private message
NeilDev

New User


Joined: 20 Jan 2010
Posts: 5
Location: UK

PostPosted: Wed Jan 27, 2010 12:24 am    Post subject:
Reply with quote

Hi Sambhaji,

In your example the output would be this:

AAAAA 12345
AAAAB 12345
AAABB 12345

Altough, I wouldn't mind too much if the code is easier and all the AAAAA records are output.

I use Z/OS DFSORT V1R10
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Wed Jan 27, 2010 12:48 am    Post subject:
Reply with quote

Hi NeilDev,
Below ICETOOL step will give you desired result.
Code:

//S1    EXEC  PGM=ICETOOL                                         
//SYSOUT    DD  SYSOUT=*                                           
//DFSMSG    DD  SYSOUT=*                                           
//TOOLMSG   DD  SYSOUT=*                                           
//IN DD *                                                         
AAAAA 12345                                                       
AAAAA 12345                                                       
AAAAA 12345                                                       
AAAAB 12345                                                       
AAABB 12345                                                       
FFFFF 55555                                                       
BBBBB 99999                                                       
BBBBB 99999                                                       
/*                                                                 
//OUT DD SYSOUT=*                                                 
//TOOLIN   DD    *                                                 
  SELECT FROM(IN) TO(OUT) ON(7,5,CH) HIGHER(1) USING(CTL1)         
/*                                                                 
//CTL1CNTL DD *                           
  SORT FIELDS=(7,5,CH,A,1,5,CH,A)         
  SUM FIELDS=NONE                         
/*                     

Output will be
Code:

AAAAA 12345
AAAAB 12345
AAABB 12345
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 Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 0 Mon Jan 02, 2017 11:16 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm


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