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

Removing records from a dataset, using keys from another?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Thu Mar 22, 2007 4:01 pm
Reply with quote

Hi,

I'd like to remove records in one dataset using a key from another dataset. Say I have these two datasets:

IN1 DD *
FFF
EEE
III
III
CCC
BBB
AAA

IN2 DD *
GGG
GGG
AAA
CCC
AAA
BBB
HHH
DDD
FFF
GGG

Any record from IN1 that is present in IN2 should be removed (including duplicates). Any record from IN1 that is NOT present in IN2 should be retained (including duplicates). In the above example, the output should be:
DDD
GGG
GGG
GGG
HHH

I've tried this code, and it works except for the fact the GGG is only present two times in the output:
Code:
//T1       DD DSN=&&T1,SPACE=(TRK,(1,1)),DISP=(MOD,PASS)
//TOOLIN   DD *                                           
  COPY FROM(IN1) TO(T1) USING(CTL1)                       
  COPY FROM(IN2) TO(T1) USING(CTL2)                       
  SPLICE FROM(T1) TO(OUT) ON(1,3,CH) KEEPBASE KEEPNODUPS -
    WITH(1,81) USING(CTL3)                                 
//CTL1CNTL DD *                                           
  INREC OVERLAY=(81:C'BB')                                 
//CTL2CNTL DD *                                           
  INREC OVERLAY=(81:C'VV')                                 
//CTL3CNTL DD *                                           
  OUTFIL FNAMES=OUT,INCLUDE=(81,2,CH,EQ,C'VV'),BUILD=(1,80)

What is the easiest way to accomblish what I need? Thanks in advance!
- Claes
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Mar 22, 2007 4:32 pm
Reply with quote

Change your splice control statement as -

Code:

SPLICE FROM(T1) TO(OUT) ON(1,3,CH) KEEPBASE KEEPNODUPS -
  WITHALL WITH(1,81) USING(CTL3)
Back to top
View user's profile Send private message
Claes Norreen

Active User


Joined: 20 Dec 2005
Posts: 137
Location: Denmark

PostPosted: Thu Mar 22, 2007 5:23 pm
Reply with quote

I thought I already tried that... Wauw , thanks, that seemed to do the job perfectly! icon_cool.gif
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
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 4
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top