Focal Point
How do I combine data from two WebFOCUS procedures

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

June 06, 2007, 05:56 PM
Patty Stoddard
How do I combine data from two WebFOCUS procedures
I have two procedures with this in common:
Both have two fields that when combined are unique (key). The created key in both procedures are identical.

I want one report with data from both procedures. Actually, I want all the data from one procudure and only data from the other procedure where the combined 'key' fields are the same.

How do I do this in WebFOCUS. By the way, I don't know how to write code. I'm a GUI person.
June 06, 2007, 06:10 PM
dwf
Patty,

Other way around for me. I'm a coder. But I'll try to help anyway.

Let's establish a vocabulary. Let's say procedure A creates hold file A1, and procedure B creates hold file B1. If you want the combine to take place immediately after A1 and B1 are created, then you probably want another procedure - call it C - that includes or executes A and B. You can do that with the GUI.

After A1 and B1 are created, you want the combine them with MATCH FILE. Click on the diamond after B and look for MATCH. Click that. The GUI will attempt to guide you through the process. I hope the help you get there is good enough, because it would be pretty complicated to explain here. If you have a creating reports manual, look for MATCH FILE. Even if you don't write code, then explanation should help.


dwf
June 07, 2007, 08:18 AM
Patty Stoddard
Thank you so much! That's exactly what I needed.
June 07, 2007, 03:00 PM
Anatess
There's also a thing called JOIN that you can do with the Report Painter GUI. Except I'm not sure if you can join 2 held files. dwf?


WF 8.1.05 Windows
June 07, 2007, 03:16 PM
Patty Stoddard
The procedures are not in the list of tables when I choose MATCH from the diamond. Our DBA do not know how to give me access to this. Any help will be appreciated.
June 07, 2007, 06:38 PM
dwf
You have to run your routines at least once to create the hold files. Master files will be created at that time, and it is the two masters you want to look for when you choose the match diamond. It is very possible that your hold files and masters are being written to temp space, which means they aren't being saved. You want to reasearch the command APP HOLDMETA to overcome that. SET TEMPDIR will do the same thing, I think. The point of all that is to persuade WebFOCUS to actually save the master file descriptions created with the HOLD statement, so you can use them in the MATCH.

And, as Anatess suggested, you should also be able to use join. It might even be a little easier. If you hold your file with FORMAT FOCUS, the join will almost certainly work better than the MATCH, anyway.

Lot of stuff to have to manage, huh?


dwf
June 12, 2007, 02:51 PM
Leah
You can join hold files as long as they have something to use as a key, which is ususally a 'by' statement field

Table file a1
print b c d
by e
on table hold as hold1
end
table file b1
print f g h
by i
on table hold as hold2
end
join e in hold1 to g in hold2

...

GUI lets you do this as well.


Leah
June 13, 2007, 08:59 AM
jgelona
Leah, don't you mean

join e in hold1 to i in hold2

I don't ever do it this way. I will always make the second hold file (hold2) a format FOCUS and INDEX i.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
June 13, 2007, 11:53 AM
Leah
Thanks I can't type the join should be
joine e in hol1 to i in hold2


Leah