Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Join Keys to compare two files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Join Keys to compare two files
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: 1568
Location: Andromeda Galaxy

PostPosted: Fri Feb 05, 2016 11:14 am    Post subject:
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

Senior Member


Joined: 21 Sep 2010
Posts: 2383
Location: NY,USA

PostPosted: Sat Feb 06, 2016 5:25 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Compare multiple files using JCL/Rexx... tanvi110788 JCL & VSAM 4 Tue May 19, 2020 5:47 pm
No new posts Need help to concatenate files with w... ssuthagar All Other Mainframe Topics 3 Fri May 15, 2020 1:39 am
No new posts Compare Two datasets and Override Mat... ArunkumarGanesan DFSORT/ICETOOL 7 Mon Apr 27, 2020 7:45 pm
No new posts Java Batch launcher JVMPRC86 does not... harisukumaran IBM Tools 2 Wed Apr 15, 2020 12:37 am
No new posts To compare an input file with a maste... lekshmi133 COBOL Programming 5 Tue Apr 14, 2020 3:01 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us