IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Join Keys to compare two files


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
senthamizh

New User


Joined: 27 Apr 2009
Posts: 23
Location: mumbai

PostPosted: Fri Feb 05, 2016 8:28 am
Reply with quote

I have a requirement to compare 2 file and write the matched records into output file with condition.

File 1: RECLEN=350,FB

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
 
APPLE20182018-02-01?                                                     
APPLE20182018-02-02?                                                     
CHIKU20182018-02-03?                                                     
CHIKU20182018-02-04?                                                     
LEMON20182018-02-05?                                                     
LEMON20182018-02-06?                                                     
TANGO20182018-02-07?                                                     
TANGO20182018-02-08? 


File 2: RECLEN=86,FB

Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
APPLEvW1XXXX  ....STOCK   2016-02-04xx..Y..V..IND..IND..S..........C..N.........
CHIKUvW1XXXX  ....STOCK   2016-02-04xx..Y..V..IND..IND..S..........O..N.. ......
LEMONvW1XXXX  ....STOCK   2016-02-04xx..Y..V..IND..IND..S..........D..N.. ......
TANGOlW1XXXX  ....STOCK   2016-02-04xx..Y..V..IND..IND..S..........C..N.. ......
MANGOgW2XXXX  ....STOCK   2016-02-04xx..Y..V..IND..IND..S..........M..N.. ......
PINEAMW2XXXX   ...STOCK   2016-02-04xx..Y..V..IND..IND..S..........E..N.. ......




key for both file is 1,5.The condion is for matched records if (68,1) is C or D or O(in file2) then 1001 is inserted in outputfile,if (68,1) is M(in file2) then 1002 is inserted in outputfile.for example Apple in file1 is matching with file 2 .for Apple in file 2 @ position 68 is set as C,so in the outputfile @ position 10 '1001' needs to be inserted. can some one help me.

The output records should be

-
Code:
---+----1----+----2----+----3----+----4----+----5----+----6----+----7--
***************************** Top of Data ******************************
APPLE201810012018-02-01?                                                     
APPLE201810012018-02-02?                                                     
CHIKU201810012018-02-03?                                                     
CHIKU201810012018-02-04?                                                     
LEMON201810012018-02-05?                                                     
LEMON201810012018-02-06?                                                     
TANGO201810022018-02-07?                                                     
TANGO201810022018-02-08?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Fri Feb 05, 2016 11:14 am
Reply with quote

Sentamizh,

With all due respect what have you tried so far..

Please let us know where you find difficulty or post the errors you have got if any

someone will be able to assist
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3051
Location: NYC,USA

PostPosted: Sat Feb 06, 2016 5:25 am
Reply with quote

Use simple dfsort join keys and ifthen conditions on reformatted records. ( you could have searched here and found many examples).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
Search our Forums:

Back to Top