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 Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm


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