Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SPUFI -- Joining 3 tables – data in 2 tables, none in 3rd

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

New User


Joined: 28 Sep 2005
Posts: 55
Location: USA

PostPosted: Wed Mar 08, 2017 4:18 am    Post subject: SPUFI -- Joining 3 tables – data in 2 tables, none in 3rd
Reply with quote

I am joining three tables with SPUFI. Tables A & B always have the data. Table 3 only has the matching data 85% of the time. I want to write out the data for tables A & B, even when Table C row is not found. Currently it only writes data when all three tables have data. Please Advise. Thank you in Advance.

Code:
****** ***************************** Top of Data 
000100 SELECT
000200       A.GROUP_NUMBER,
000201       A.DEFAULT_YEAR,
000210       B.FK_SALE_NO,
000500       C.USE_KEY_1
000800 FROM  DBTCTR8.TRTPSDTP A,
000900       DBTCTR8.TRTPSTPS B,
000910       DBTCTR8.TRTPUKEY C
001000 WHERE A.GROUP_NUMBER = 2039014031
001010 AND   A.DEFAULT_YEAR = 2002
001011 AND   A.GROUP_NUMBER = B.FK_SDTP_GROUP_NO
001020 AND   (B.FK_SDTP_GROUP_NO = C.FK_STPTS_AIN (or C.row not found))
001230 GROUP BY A.GROUP_NUMBER, A.DEFAULT_YEAR, C.USE_KEY_1,
001240      B.FK_SALE_NO;
****** **************************** Bottom of Data
Back to top
View user's profile Send private message

RahulG31

Active User


Joined: 20 Dec 2014
Posts: 408
Location: USA

PostPosted: Wed Mar 08, 2017 5:33 am    Post subject: Reply to: SPUFI -- Joining 3 tables – data in 2 tables, none in 3rd
Reply with quote

Ever heard of Outer Join?

.
Back to top
View user's profile Send private message
Sysaron

New User


Joined: 28 Sep 2005
Posts: 55
Location: USA

PostPosted: Wed Mar 08, 2017 5:38 am    Post subject:
Reply with quote

This newbie will look it up. Thank you. icon_lol.gif
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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Fetching data from JHS as per the cur... arunsoods All Other Mainframe Topics 4 Wed Nov 22, 2017 1:54 pm
No new posts Extract Record using range of Data scorp_rahul23 DFSORT/ICETOOL 3 Wed Nov 15, 2017 11:54 pm
No new posts Updating data from one file to other!!! Vignesh Sid SYNCSORT 1 Mon Nov 06, 2017 2:42 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am

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