MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
Sreejith Intermediate Joined: 02 Dec 2002 Posts: 155 Topics: 25 Location: N.Ireland
Posted: Wed Aug 23, 2006 6:11 am Post subject: Exclude records using sort
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
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12372 Topics: 75 Location: San Jose
Posted: Wed Aug 23, 2006 8:04 am Post subject:
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
dz Beginner Joined: 02 Apr 2006 Posts: 26 Topics: 0
Posted: Wed Aug 23, 2006 8:06 am Post subject:
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
Sreejith Intermediate Joined: 02 Dec 2002 Posts: 155 Topics: 25 Location: N.Ireland
Posted: Wed Aug 23, 2006 8:27 am Post subject:
Kolusu,
Thanks very much. will move this to production
Thanks
Sreejith
Back to top
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