Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Difference between PRINT AND SUM

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] Difference between PRINT AND SUM
 Login/Join
 
Silver Member
posted
Hello, What is the exact difference between SUM and PRINT in a MATCH statement?

For example:
  
MATCH FILE FILE1                                                             
SUM FIELD_1                                                          
BY CODE AS KEY                                           
RUN                                                                             
FILE FILE2                                                             
SUM FIELD_2                                                            
BY CODE AS KEY
AFTER MATCH HOLD AS HOLDF OLD-OR-NEW    


Assumming the data contained in the two files is:

FILE_1 FILE_2
------------ ------------
code field_1 code field_2
1 10 1 50
2 20 2 30
4 30 3 40

What would my final result be? What would be the difference if I put PRINT instead of SUM?

Thank you

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


WebFOCUS 7.1.4
Windows, All Outputs
 
Posts: 35 | Registered: December 21, 2011Report This Post
Platinum Member
posted Hide Post
I would suggest you read the section "Fine-Tuning MATCH Processing" in chapter 16 of the Creating Reports with WebFOCUS Language book.

Copy & pasting of about 4 pages iof information is frowned upon by our illustrious admin :-)


Robert F. Bowley Jr.
Owner
TaRa Solutions, LLC

In WebFOCUS since 2001
 
Posts: 132 | Location: Gadsden, Al | Registered: July 22, 2005Report This Post
Platinum Member
posted Hide Post
When you write SUM at the 'NEW' level, Match is informed that there will be, at most, One Record for a given KEY Value.
So OLD is O,1 for a KEY Value
And Same is NEW
You Use OLD-OR_NEW, so if any KEY value being in the OLD And / Or in the New will give birth
to One single Record in HOLDF File

When You Use PRINT instead of SUM at the New Level, Match Knows that he doesn't know ( and he won't check for each KEY value at the New Level)
What he knows is that (0,n) is the cardinality of New for any Code Value.

When the cardinality is 0,1 (SUM) Match won't hesitate to replicate the values found on the OLD level onto All the instances Brought on the NEW level
Other he won't do that
In the old Days he Wrote Max (Nb Old, Nb New) records. The ith record contained the ith instance Old Level juxtaposed to the ith instance New Level
Now, When You Set CARTESIAN = ON you get closer of SQL Inner Join : Nb Old * Nb New instances out. Each Old Instance being being juxtaposed by All New instances.

Match, often, surprises IT guys.
But it does exactly what the Focus Bible says it does ( and not one fancy it does )

Now I bet for :
Code Field1 Field2
1 10 50
2 20 30
3 40
4 30

I Guess that, with a Sum there won't be Missing Values, like a SegType = DKU son

And with a Print
Code Field1 Field2
4 30 .
Field2 Would be a Missing Value like a SegType = DKM Value

I know that I Know nothing, but that I know.
Focus is real great when he handles cardinality. But for me, it's not a subject for writing on a corner of a table. You've got to have your brains rather intensely concentrated .

Just wait for Tony A and/or Waz to fix your question in two brilliant and funny lines ...
Cordially and Focusely


Focus Mainframe 7.6.11
Dev Studio 7.6.11 and !!!
PC Focus, Focus for OS/2, FFW Six, MSO
 
Posts: 134 | Registered: November 06, 2007Report This Post
Platinum Member
posted Hide Post
Should know that Spaces are brought to one by HTML. I bet For :
  
Code Field1 Field2
1 10 50
2 20 30
3    40
4 30 


Focus Mainframe 7.6.11
Dev Studio 7.6.11 and !!!
PC Focus, Focus for OS/2, FFW Six, MSO
 
Posts: 134 | Registered: November 06, 2007Report This Post
Silver Member
posted Hide Post
quote:

You've got to have your brains rather intensely concentrated .

Nothing but the truth

Thank you so much for your help and your time.


WebFOCUS 7.1.4
Windows, All Outputs
 
Posts: 35 | Registered: December 21, 2011Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Difference between PRINT AND SUM

Copyright © 1996-2020 Information Builders