Focal Point
[SOLVED] MATCH FILE and OLD-AND-NEW; Is this normal?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5467007276

September 17, 2014, 11:21 AM
Wep5622
[SOLVED] MATCH FILE and OLD-AND-NEW; Is this normal?
To my understanding, MATCH FILE with the OLD-AND-NEW match phrase and 3 files should combine as follows:
(FILE1 AND FILE2) AND FILE3


Oddly enough, I get the following output in my source:
MATCH
FILE FILE1
BY PART_NO
RUN
FILE FILE2
BY PART_NO
RUN
FILE FILE3
BY PART_NO
AFTER MATCH HOLD OLD-AND-NEW
END
-RUN
0 NUMBER OF RECORDS SELECTED=      153  LINES=    153
0 NUMBER OF RECORDS SELECTED=       10  LINES=     10
0 LINES OF MATCH OUTPUT     =      163
0 NUMBER OF RECORDS SELECTED=      277  LINES=    273
0 LINES OF MATCH OUTPUT     =        5


153 lines from FILE1 and 10 lines from FILE2 could not possibly result in 163 lines with OLD-AND-NEW, can it?!? That looks like it's actually applying OLD-OR-NEW there.

Is this a bug or intended?

This message has been edited. Last edited by: Wep5622,


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 :
September 17, 2014, 11:42 AM
j.gross
Yes, it's intended.


Each FILE step pulls data and creates an internal matrix.

Each FILE step (other than the first) is followed by a Merge process, merging the rows of the "OLD" and "NEW" matrices into a single one, by applying whichever of the eight merge options (OLD, NEW, OLD-NOT-NEW, etc.) is specified in the AFTER MATCH clause. The output of the merge becomes the "OLD" matrix for the next step.

If the AFTER MATCH clause before RUN is omitted, it defaults to
"AFTER MATCH HOLD OLD-OR-NEW"
-- hence the 163 rows produced by the first merge.

This message has been edited. Last edited by: j.gross,


- Jack Gross
WF through 8.1.05
September 17, 2014, 01:47 PM
RSquared
So then try it this way ?

quote:
MATCH
FILE FILE1
BY PART_NO
RUN
FILE FILE2
BY PART_NO
RUN
FILE FILE3
AFTER MATCH HOLD OLD-AND-NEW
BY PART_NO
AFTER MATCH HOLD OLD-AND-NEW
END
-RUN



WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
September 17, 2014, 03:38 PM
j.gross
No, AFTER ... goes before RUN:
MATCH FILE car
BY CAR 
IF COUNTRY EQ ENGLAND OR FRANCE
  RUN
FILE car
BY CAR 
IF COUNTRY EQ ENGLAND OR JAPAN
  AFTER MATCH HOLD OLD-AND-NEW
  RUN
FILE car
BY CAR 
IF COUNTRY EQ ITALY OR ENGLAND
  AFTER MATCH HOLD OLD-AND-NEW
  END

TABLEF FILE HOLD LIST *
END
-RUN

September 17, 2014, 04:00 PM
RSquared
you are right, just a finger slip


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
September 18, 2014, 03:48 AM
Wep5622
Well what do you know, you can repeat AFTER MATCH! I learned something new again, which makes this a fairly educational couple of days - thanks!


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 :