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 have this issue when using MATCH to combine records:
MATCH FILE HOLDA
PRINT FIELDA
BY FIELDB
BY FIELDC
RUN
FILE HOLDB
PRINT FIELDA
BY FIELDB
BY FIELDC
RUN
AFTER MATCH HOLD AS HOLD_TEMP_RT OLD-OR-NEW
Then, the output I got is :
FIELDB FIELDC FIELDA
BBB CCC
BBB CCC
BBB CCC AAA
This meant I just got 1 value of Field A although I have values of this field for all records. If I change PRINT FIELDA to BY FIELDA, it displays all but it will sort FIELDA, I don't want FIELDA is sorted, anyone have solution for this ? I also tried SUM FIELDA but it didn't work.
Thanks in advance.
This message has been edited. Last edited by: hainguyen,
Let me edit my example code as following: MATCH FILE HOLDA PRINT FIELDA1 BY FIELDB1 BY FIELDC1 RUN FILE HOLDB PRINT FIELDA2 BY FIELDB2 BY FIELDC2 AFTER MATCH HOLD AS HOLD_TEMP_RT OLD-OR-NEW END Then, the output I got is : FIELDB FIELDC FIELDA B1B1B1 C1C1C1 B2B2B2 C2C2C2 B3B3B3 C3C3C3 A3A3A3
It supposes to have value A1A1A1 in the first record and A2A2A2 in the second record but if I use PRINT in FIELDA1 and FIELDA2, it doesn't show up those data. And I need to use OLD-OR-NEW because data in these HOLD files is different.
This message has been edited. Last edited by: hainguyen,
MATCH is a strange beast, but as far as I understand, your initial example would result in a file containing: FIELDB FIELDC FIELDA FIELDA
Meaning that there are TWO fields in the result named FIELDA. Perhaps you're just not printing the correct one? You can check that using ?FF HOLD_TEMP_RT
If that's your issue, does this fare better?
SET ASNAMES = ON
SET HOLDLIST = PRINTONLY
MATCH
FILE HOLDA
PRINT FIELDA AS FIELDAA
BY FIELDB
BY FIELDC
RUN
FILE HOLDB
PRINT FIELDA AS FIELDBA
BY FIELDB
BY FIELDC
AFTER MATCH HOLD AS HOLD_TEMP_RT OLD-OR-NEW
END
-RUN
TABLE FILE HOLD_TEMP_RT
PRINT COMPUTE FIELDA/??? = IF FIELDAA IS MISSING THEN FIELDBA ELSE FIELDAA;
BY FIELDB
BY FIELDC
END
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
Waz: My code is the mess now so that's why I use the sample code. j.gross: Sorry, I mistyped it. I changed it. Dave/Wep5622/Twanette: Thanks for your suggestion but they seem didn't work in my case. Please let me explain more detail my report. I need to get TDLine in READ_TEXT function so I need to pass some parameters to this function. I used the loop to pass each set of values for parameters each time to get TDLine, then I use MATCH to merge these records and save them to 1 Hold file. Then I just need to print this HOLD file to get the complete report. The issue I got is for 1 set of values, in my sample code, I get 1 line of FIELDB, one line of FIELDC but many lines of FIELDA and these lines need to be kept in the original order ( I can't sort them). I tried to use MATCH and I got the issue as I mentioned above. I can't get full FIELDA for all set of values or if I use BY for FIELDA, this field will be sorted and this will be wrong. I think I am so close with the solution but it seems I never touch it.
My code is almost like below except I used the loop statement to pass data to TDNAME, LText is the field I want to get from READ_TEXT.
MATCH FILE HOLDA
BY HOLDA.HOLDA.EINA_MATNR AS 'MATNR'
BY HOLDA.HOLDA.EINA_INFNR AS 'INFNR'
BY HOLDA.HOLDA.EINA_LIFNR AS 'LIFNR'
BY J3.LINES.LINES_TDLINE AS 'LTEXT'
WHERE (J3.READ_TEXT.HEADER_TDID EQ 'BT') AND ( J3.READ_TEXT.HEADER_TDOBJECT EQ 'EINE' ) AND ( J3.READ_TEXT.HEADER_TDSPRAS EQ 'E' ) AND ( J3.READ_TEXT.HEADER_TDNAME EQ '1111' );
RUN
FILE HOLDA
BY HOLDA.HOLDA.EINA_MATNR AS 'MATNR'
BY HOLDA.HOLDA.EINA_INFNR AS 'INFNR'
BY HOLDA.HOLDA.EINA_LIFNR AS 'LIFNR'
BY J3.LINES.LINES_TDLINE AS 'LTEXT'
WHERE (J3.READ_TEXT.HEADER_TDID EQ 'BT') AND ( J3.READ_TEXT.HEADER_TDOBJECT EQ 'EINE' ) AND ( J3.READ_TEXT.HEADER_TDSPRAS EQ 'E' ) AND ( J3.READ_TEXT.HEADER_TDNAME EQ '2222' );
AFTER MATCH HOLD AS HOLD_MAT_RT OLD-OR-NEW
END
RUN
TABLE FILE HOLD_MAT_RT
BY MATNR
BY INFNR
BY LIFNR
BY LTEXT
ON TABLE PCHOLD FORMAT HTML
This message has been edited. Last edited by: hainguyen,
Based on what you want to do, I still don't think you should be using MATCH FILE.
quote:
I use MATCH to merge these records and save them to 1 Hold file. Then I just need to print this HOLD file to get the complete report.
Based on the code you sent, try this:
TABLE FILE HOLDA
PRINT J3.LINES.LINES_TDLINE AS 'LTEXT'
BY HOLDA.HOLDA.EINA_MATNR AS 'MATNR'
BY HOLDA.HOLDA.EINA_INFNR AS 'INFNR'
BY HOLDA.HOLDA.EINA_LIFNR AS 'LIFNR'
BY J3.LINES.LINES_TDLINE AS 'LTEXT'
WHERE (J3.READ_TEXT.HEADER_TDID EQ 'BT') AND ( J3.READ_TEXT.HEADER_TDOBJECT EQ 'EINE' ) AND ( J3.READ_TEXT.HEADER_TDSPRAS EQ 'E' ) AND ( J3.READ_TEXT.HEADER_TDNAME EQ '1111' );
MORE
FILE HOLDA
WHERE (J3.READ_TEXT.HEADER_TDID EQ 'BT') AND ( J3.READ_TEXT.HEADER_TDOBJECT EQ 'EINE' ) AND ( J3.READ_TEXT.HEADER_TDSPRAS EQ 'E' ) AND ( J3.READ_TEXT.HEADER_TDNAME EQ '2222' );
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS HOLD_MAT_RT
END
TABLE FILE HOLD_MAT_RT
PRINT LTEXT
BY MATNR
BY INFNR
BY LIFNR
BY LTEXT
ON TABLE PCHOLD FORMAT HTML
END
WebFOCUS 8.2.06 mostly Windows Server
Posts: 195 | Location: Johannesburg, South Africa | Registered: September 13, 2008
Thanks Twanette. This totally works in my case. Just wanna change your code a little bit. ON TABLE should be at the first table. Look like all my issues are solved just by MORE.
TABLE FILE HOLDA
PRINT J3.LINES.LINES_TDLINE AS 'LTEXT'
BY HOLDA.HOLDA.EINA_MATNR AS 'MATNR'
BY HOLDA.HOLDA.EINA_INFNR AS 'INFNR'
BY HOLDA.HOLDA.EINA_LIFNR AS 'LIFNR'
BY J3.LINES.LINES_TDLINE AS 'LTEXT'
WHERE (J3.READ_TEXT.HEADER_TDID EQ 'BT') AND ( J3.READ_TEXT.HEADER_TDOBJECT EQ 'EINE' ) AND ( J3.READ_TEXT.HEADER_TDSPRAS EQ 'E' ) AND ( J3.READ_TEXT.HEADER_TDNAME EQ '1111' );
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SET ASNAMES ON
ON TABLE HOLD AS HOLD_MAT_RT
MORE
FILE HOLDA
WHERE (J3.READ_TEXT.HEADER_TDID EQ 'BT') AND ( J3.READ_TEXT.HEADER_TDOBJECT EQ 'EINE' ) AND ( J3.READ_TEXT.HEADER_TDSPRAS EQ 'E' ) AND ( J3.READ_TEXT.HEADER_TDNAME EQ '2222' );
END
TABLE FILE HOLD_MAT_RT
PRINT LTEXT
BY MATNR
BY INFNR
BY LIFNR
BY LTEXT
ON TABLE PCHOLD FORMAT HTML
END