Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 22
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: 1529
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: 1609
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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How can we have the varying lenth of ... Gunapala CN DFSORT/ICETOOL 6 Fri Oct 14, 2016 7:31 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Joinkeys with duplicated keys juares castro SYNCSORT 19 Fri Sep 23, 2016 5:58 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us