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 

Filtering of records

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


Joined: 18 Apr 2007
Posts: 16
Topics: 10

PostPosted: Mon Apr 28, 2008 4:30 am    Post subject: Filtering of records Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Mon Apr 28, 2008 10:22 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
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