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.
The following code gives you the result you're looking for. I'm not 100% sure this will work in the real world.
I create a master and datafile to simulate the data you provide. I have to make a FOCUS DB because recursive joins do not work on flat files. If you're reading a DBMS table, you do not have to create a FOCUS DB.
The recursive join uses TAG to uniquely qualify the field names in the recursive join.
-SET &ECHO=ON;
SET HOLDLIST=PRINTONLY
-RUN
-*-- Create the master for TEST6 -----------------
FILEDEF DATAMAST DISK TEST6.MAS
-RUN
-WRITE DATAMAST FILE=TEST6, SUFFIX=FIX, $
-WRITE DATAMAST SEGNAME=SEG1, SEGTYPE=S2, $
-WRITE DATAMAST FIELD=PITEM, ALIAS=PITEM, USAGE=A11, ACTUAL=A11, $
-WRITE DATAMAST FIELD=CITEM, ALIAS=CITEM, USAGE=A11, ACTUAL=A11, $
-*-- Create the data file for TEST6 --------------
FILEDEF TEST6 DISK TEST6.FTM
-RUN
-* 1234567890A1234567890A
-WRITE TEST6 00876645203 86028881
-WRITE TEST6 86028881 09845997
-WRITE TEST6 86028881 86029391
-*-- Create a FOCUS database ---------------------
TABLE FILE TEST6
PRINT
PITEM NOPRINT
BY PITEM
BY CITEM
ON TABLE HOLD AS HTEST6 FORMAT FOCUS INDEX PITEM CITEM
END
-RUN
-*-- Create the report ---------------------------
SET ALL=ON
JOIN CITEM IN HTEST6 TO ALL PITEM IN HTEST6 TAG T1 AS J1
-RUN
?FF HTEST6
-RUN
TABLE FILE HTEST6
SUM
COMPUTE DUMMY1/A1 = ''; NOPRINT
BY PITEM
BY HIGHEST 1 T1.CITEM
WHERE T1.CITEM IS NOT MISSING
END
Recursive joins are described here: Describing Data With WebFOCUS Language > Describing a Group of Fields > Recursive Relationships and here: Creating Reports With WebFOCUS Language > Joining Data Sources > Types of Joins > Recursive Joined Structures.
Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server