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
 
Table Join with different values

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Thu Apr 18, 2013 12:19 pm    Post subject: Table Join with different values
Reply with quote

Hi,

I have 2 tables which needs to be joined based on Client and Product.

However one product is AA in Table A and BB in Table B. All other products are same on both tables. Is it possible to Join A and B for AA and BB. they are both same. Please let me know.

Code:


Table A
Client    Prod
----------------
123       AA
123       XX
345       TT
567       ZZ

Table B
Client  Prod  Data
---------------------
123     BB      Product Data1
123     XX     Product Data 2
345     TT     Product Data 3

Expected output 

Client   Prod         Data
-------------------------------
123      AA/BB       Product Data1
123     XX             Product Data 2
345     TT              Product Data 3

   


Please suggest if this is feasible through a left join or some way. I tried the REPLACE command in a left join but it was not working
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Apr 18, 2013 7:56 pm    Post subject:
Reply with quote

Hello,

How many other mis-matched pairs might eventually need to be supported? Why is there this mis-match?

How much would it take to make this value consistent in both files?

What you want to do would be trivial in a program and would be easier to expand if the requirement "grows".
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Mon Apr 22, 2013 12:49 pm    Post subject:
Reply with quote

HI Dick,

looks like there was a miscommunication among team located at different locations and evantually 2 various entries came into place. I guess this is the only entry that will remain so.
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Adding a userid to SMTP Security table Yolanda Harvey JCL & VSAM 1 Sun Aug 13, 2017 6:16 pm
No new posts BI,TO=ZD Changing Values Tyler Dunbar DFSORT/ICETOOL 4 Tue Jul 25, 2017 12:12 am
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm


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