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

Elimination of dups with specific value


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. Construct new record using specific f... DFSORT/ICETOOL 6
No new posts Select a DB2 value in a specific deci... DB2 4
No new posts Need to find a specific STRING COBOL Programming 11
No new posts Output LREC based on specific character DFSORT/ICETOOL 22
No new posts Access an specific memory address exp... COBOL Programming 1
Search our Forums:

Back to Top