MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
shashank.sharma Beginner Joined: 18 Apr 2007 Posts: 16 Topics: 10
Posted: Mon Apr 28, 2008 4:30 am Post subject: Filtering of records
File A
ID
------------
12
15
86
File B
Name,ID,Indicator,Amount
--------------
ABD 12 X 026
CDE 11 Y 022
EFG 86 Z 055
I need those records from file B where ID = (present in file A) and Amount > 25 in a third file (File C), i.e.,
File C
----------------
ABD 12 X 026
EFG 86 Z 055
How can I do that?
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Mon Apr 28, 2008 10:22 am Post subject:
shashank.sharma ,
The following DFSORT/ICETOOL JCl will give you the desired results. I assumed that your input files are of FB recfm and 80 bytes in length.
Code:
//STEP0100 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD *
12
15
86
//IN2 DD *
----+----1----+----2----+----3----+----4----+----5----+----6----+----7-
ABD 12 X 026
CDE 11 Y 022
EFG 86 Z 055
//T1 DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT DD SYSOUT=*
//TOOLIN DD *
COPY FROM(IN1) USING(CTL1)
COPY FROM(IN2) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(5,2,CH) WITH(01,80) KEEPNODUPS USING(CTL3)
//CTL1CNTL DD *
OUTFIL FNAMES=T1,BUILD=(5:1,2,80:X,1,2)
//CTL2CNTL DD *
OUTFIL FNAMES=T1,OVERLAY=(81:2X)
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,BUILD=(01,80),
INCLUDE=(81,2,CH,EQ,5,2,CH,AND,10,3,ZD,GT,25)
/*
Hope this helps...
Cheers _________________ Kolusu
www.linkedin.com/in/kolusu
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