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
 

 

Elimination of dups with specific value

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

New User


Joined: 22 May 2009
Posts: 2
Location: Pune

PostPosted: Mon Aug 31, 2009 12:02 pm    Post subject: Elimination of dups with specific value
Reply with quote

Given a file I want to eliminate only those duplicate records on key which have specific value on a particular field.

suppose In the example given below first column is key. second column contain specific value .I want to elimiante only those duplicates on key with value 'C' in the second column.
Input :
---------
C1 A
C1 B
C1 C
C2 C
Expected Output:
---------------------
C1 A
C1 B
C2 C

Please provide solution

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

Skolusu

Senior Member


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

PostPosted: Mon Aug 31, 2009 9:13 pm    Post subject:
Reply with quote

vijaya kommuri,

The following DFSORT/ICETOOL JCL will give you the desired results. I assumed your input LRECL to be 80 and FB recfm.

Code:

//STEP0100 EXEC PGM=ICETOOL                                       
//TOOLMSG  DD SYSOUT=*                                             
//DFSMSG   DD SYSOUT=*                                             
//IN       DD *                                                   
C1 A                                                               
C1 B                                                               
C1 C                                                               
C2 C                                                               
//OUT      DD SYSOUT=*                                             
//TOOLIN   DD *                                                   
  SELECT FROM(IN) TO(OUT) ON(1,2,CH) ON(81,8,CH) FIRST USING(CTL1)
//CTL1CNTL DD *                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),               
  IFTHEN=(WHEN=(4,1,CH,EQ,C'C'),                                   
  OVERLAY=(81:81,8,ZD,SUB,+1,M11,LENGTH=8))                       
  OUTFIL FNAMES=OUT,BUILD=(1,80)                                   
/*
Back to top
View user's profile Send private message
gayathrinag

New User


Joined: 16 Oct 2008
Posts: 37
Location: chennai

PostPosted: Mon Sep 07, 2009 6:41 pm    Post subject:
Reply with quote

Hi Skolusu,
I just tried the below sort and its working fine for the above.

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
C1 A
C1 B
C1 C
C2 C
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,2,CH) ON(3,1,CH) ALLDUPS
/*

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

Senior Member


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

PostPosted: Tue Sep 08, 2009 9:28 pm    Post subject:
Reply with quote

gayathrinag,

Did you even read the requirement? Did you see what you got as output and compare it against the original required output? I ran your job as is and this is what I got

Quote:

C1 A
C1 B
C1 C


if you look at the required output OP needs

Quote:

C1 A
C1 B
C2 C


Apart from that You are using ALLDUPS parm which would eliminate any unique records. If you want to post a solution please make sure that it works according to the requirements.
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 how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am
No new posts How to calculate an specific transact... lind sh CICS 2 Tue Sep 13, 2016 9:20 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am
No new posts insert the same records but chancing ... danylele74 DB2 6 Mon May 02, 2016 7:22 pm
No new posts Free FILE not working for specific users sankalp-goyal CLIST & REXX 12 Mon Apr 25, 2016 6:33 pm


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