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

Moderator


Joined: 07 Sep 2006
Posts: 1565
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: 2567
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
This topic is locked: you cannot edit posts or make replies. Copy list of files from PS to another... CLIST & REXX 11
No new posts JOINKEYS to match two input files on ... DFSORT/ICETOOL 3
No new posts Hexadecimal Group compare and write t... DFSORT/ICETOOL 5
No new posts Group comparison/update between two f... DFSORT/ICETOOL 10
No new posts Need assistance formatting when joini... SYNCSORT 8
Search our Forums:

Back to Top