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
 
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 Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts How could i share my personal dataset... James Halley TSO/ISPF 1 Fri Mar 23, 2018 9:41 pm
This topic is locked: you cannot edit posts or make replies. How could i share my personal dataset... samenxia163 TSO/ISPF 1 Fri Mar 09, 2018 12:18 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am

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