MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Exclude records using sort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Sreejith
Intermediate


Joined: 02 Dec 2002
Posts: 155
Topics: 25
Location: N.Ireland

PostPosted: Wed Aug 23, 2006 6:11 am    Post subject: Exclude records using sort Reply with quote

Is it possible to use sort to exclude records from file A based on File B.

Here is the scenario

File A (key is first 4 characters. contains duplicate records. can have upto 100 duplicate record for same key)

AAAA 234
AAAA 123
BBBB 234
CCCC 123
DDDD 567

File B

AAAA
BBBB

Output should contain just

CCCC 123
DDDD 567



Thanks
Sreejith
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12372
Topics: 75
Location: San Jose

PostPosted: Wed Aug 23, 2006 8:04 am    Post subject: Reply with quote

sreejith,

The following DFSORT/ICETOOL job will give you the desired results.

Code:

//STEP0100 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN1      DD *                                           
AAAA 234                                                   
AAAA 123                                                   
BBBB 234                                                   
CCCC 123                                                   
DDDD 567                                                   
//IN2 DD *                                                 
AAAA                                                       
BBBB                                                       
//OUT   DD SYSOUT=*                                       
//T1    DD DSN=&&T1,UNIT=SYSDA,SPACE=(TRK,(5,5)),         
//         DISP=(MOD,PASS)                                 
//TOOLIN DD *                                             
  COPY FROM(IN2) TO(T1) USING(CTL2)                       
  COPY FROM(IN1) TO(T1) USING(CTL1)                       
  SPLICE FROM(T1) TO(OUT) ON(1,4,CH) WITH(1,10) WITHALL - 
  KEEPNODUPS KEEPBASE USING(CTL3)                                   
//CTL1CNTL DD *                                           
  OUTREC FIELDS=(1,10,4X)                                 
//CTL2CNTL DD *                                           
  OUTREC FIELDS=(1,4,6X,1,4)                               
//CTL3CNTL DD *                                           
  OUTFIL FNAMES=OUT,INCLUDE=(11,4,CH,EQ,C' '),OUTREC=(1,10)
/*                                                         


Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dz
Beginner


Joined: 02 Apr 2006
Posts: 26
Topics: 0

PostPosted: Wed Aug 23, 2006 8:06 am    Post subject: Reply with quote

You did not specify whether you are using SYNCSORT or DFSORT.
If you have SYNCSORT for z/OZ version 1.2, you can use new JOIN feature.
Back to top
View user's profile Send private message
Sreejith
Intermediate


Joined: 02 Dec 2002
Posts: 155
Topics: 25
Location: N.Ireland

PostPosted: Wed Aug 23, 2006 8:27 am    Post subject: Reply with quote

Kolusu,
Thanks very much. will move this to production Smile

Thanks

Sreejith
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group