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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

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