As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I am new to merging files. Do you have any good examples? My case is as follows:
All the files are stored in DB2/400 as relational databases File 1 - Transportation File - Sort Fields Company Branch Division Year File Suffix. Only one record per sort File 2 - Container File - Sort Fields same as above. Multiple records per sort depending on the number of containers per each transportation file File 3 - Purchase Order - Sort Field House Bill #, this file is only existing in File 1 - Multiple records per sort
Can anyone help?
Posts: 9 | Location: Wood Dale, IL | Registered: October 04, 2004
Terri, can you JOIN them? JOIN COMPANY AND BRANCH AND DIVISION AND YEAR IN FILE1 TO ALL COMPANY AND BRANCH AND DIVISION AND YEAR IN FILE2 AS J1 ...then i don't know about your next file, what is the key field? JOIN keyfield IN FILE1 TO ALL keyfield IN FILE3 AS J2
Use the fewest fields possible to define a join, and in DB2 make sure those fields are indexed (your DB2 D.B.A. can tell you or do it for you)
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Thanks for your advice. I already tried this but the results are not what I expected. Here is my code(see my comments after code"):
"SET ALL = ON JOIN CLEAR * JOIN POHJ02.POHFCO AND POHJ02.POHFBR AND POHJ02.POHFDV AND POHJ02.POHFYR AND POHJ02.POHFL# AND POHJ02.POHFSF IN POHJ02 TO ALL CXL003.CXCOCD AND CXL003.CXBRCD AND CXL003.CXDVCD AND CXL003.CXFLYY AND CXL003.CXFILE AND CXL003.CXFSFX IN CXL003 AS J0 END JOIN POHJ02.POHCUC AND POHJ02.POHHAB IN POHJ02 TO T@TTFL04.TTCUC AND T@TTFL04.TTHBL IN T@TTFL04 AS J0 END
-*HEADING -*"DAILY IMPORT ACTIVITY REPORT FOR CUSTOMER <POHCUN>" PRINT TTHBL AS 'House Bill #' ESDATE AS 'Expected Ship Date' EXPORTDATE AS 'Export Date' COMPUTE CNTR#/A12 = CXCACD | ' ' | CXCNCD; AS 'Cntr#' POHSCNM AS 'Shipper Name' POHPO# AS 'Customer PO #' PODPT# AS 'Part Number' PODPND AS 'Commodity Description' PODQTY AS 'Quantity' IMPORTDATE AS 'Import Date' TTPOD AS 'Destination' DESTDATE AS 'ETA Dest Date' EDDATE AS 'Delivery Requested Date' CONSDATE AS 'Del to Cnee Date' COMPUTE ESDVAR/I4 = MDY(ESDATEC, EDATEC); AS 'Expected Ship Date to Export Date' COMPUTE TRXPOEVAR/I4 = MDY(TTCDTLI, TTFDT1I); AS 'Transit Time to POE' COMPUTE TRXDSTVAR/I4 = MDY(TTCDTLI, TTCDTDI); AS 'Transit Time to ETA Dest Date' COMPUTE TRXCNSVAR/I4 = MDY(TTCDTLI, TTDTDCI); AS 'Transit Time to Cnee Date' BY ESDATE NOPRINT BY POHHAB NOPRINT WHERE (POHCUC EQ '&CONS' OR POHCUF EQ '&CONS') AND ((POHHAB EQ ' ') OR (TTRCT EQ 'OIFI' OR 'AIFI') AND (IDATE GE '200409')); ON TABLE PCHOLD FORMAT EXL2K ON TABLE SET PAGE-NUM OFF"
The problem is that the records multiply because of the following:
1) POHJ02 has multiple records for the index. 2) CXL003 has multiple record for the index. 3) T@TTFL04 only has one record per index, but I can not use this as my main file because I need to get records from POHJ02 that have a null POHHAB or a value in POHHAB that meets the selection criteria. Also, the report must be sorted by a field in the main file (POHJ02) and WEBFOCUS expects me to use only fields from the main file for my sort. 3) Example result as below: House Bill # Expected Ship Date Export Date Cntr# Shipper Name Customer PO # Part Number Commodity Description Quantity
So, for S04090598NJ I should only get two records in my result, one for CNTR CBHU 0605185 PO # 168018 PT# 1030010 (qty = 17776) and one for CNTR CBHU 1796701 PO #167387 PT # 4581012 (qty = 1500)
What am I doing wrong?
Posts: 9 | Location: Wood Dale, IL | Registered: October 04, 2004
Terri, I looked out over your request. There are two possibilities that come to mind, . 1) Is there another matching key between pohj02 and cxl003, specifically, CXCNCD . If so, then add that to the JOIN. Then, you will only get one match.
If that is not possible, then how about changing your PRINT to a SUM, and adding BY CXCACD NOPRINT BY cxcncd NOPRINT (You might also need to change the PODQTY to AVE.PODQTY so that you don't get jthe multiplicative effect.
If neither one of those will do it,open a case with Customer Support -- either through techsupport CASE MANAGEMENT, or by calling us at 1-800-736-6130 . I suspect that we would need the masters for the two major files.
Posts: 60 | Location: 2 penn | Registered: May 22, 2003
Hi Noreen, Unfortunately there are no other fields from the main file with CXL003 to match, so I will try your second proposal and will let you know the results.
Thanks for your input!
Posts: 9 | Location: Wood Dale, IL | Registered: October 04, 2004