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
 

 

Removing records from a dataset, using keys from another?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Removing records from a dataset, using keys from another?
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: 1439
Location: Bangalore,India

PostPosted: Thu Mar 22, 2007 4:32 pm    Post subject:
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    Post subject:
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    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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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