Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us