Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JOIN from HOLD Files possible?

Status
Not open for further replies.

kaeserea

Programmer
Feb 26, 2003
164
DE
Hello!

Is it possible to create two HOLD Files and then make a JOIN which combines these two Files? If yes do I need a special FORMAT for the HOLD file?

Regards
Eva
 
Eva,

Use something like this:
TABLE FILE F1
...
ON TABLE HOLD AS H1 FORMAT FOCUS
END

TABLE FILE F2
...
ON TABLE HOLD AS H2 FORMAT FOCUS INDEX KEY_FIELD2
END

JOIN KEY_FIELD1 IN F1 TO (ALL?) KEY_FIELD2 IN F2 AS J1

Hope this helps
Grzegorz
 
Hello Grzegorz,

Thanks for the FORMAT and INDEX hint. I gues the ON TABLE HOLD INDEX KEY_FIELD1 is also needed for TABLE FILE F1 if I want to use it in the following JOIN?

I did a COMPUTE in the first HOLD. The problem now is that WebFocus does not know this field when I create a TABLE after the JOIN with PRINT COMPUTED_FIELD. Does that mean that computed fields are not onsidered in the join? Do I have to make a DEFINE after the Join instead?

Eva
 
Eva,

Indexing join key in the master table (H1 in the example) is not necessary, but not harmful as well.
COMPUTEed fields in the HOLDed files are just the normal fields.
Could you send a sample code ?
You can also put
Code:
-SET &ECHO=ALL;
in the first line of the focexec, the generated report should contain some useful information within HTML comments.

Grzegorz
 
Actually, you can JOIN two HOLD files, but there are certain rules and restrictions. These are a result of HOW we do the JOIN with sequential files. We NEVER back up. As a result, the 2 rules are:

1. Both files must be sorted in ascending order, on the common field (used for the JOIN).

2. There can be duplicate values in only ONE of the files. If in the host, the you should use a JOIN ... TO ...; if in the target use JOIN ... TO ALL .... If there are duplicates in both files (which would require us to back up to correctly process, then use the HOLD FORMAT FOCUS INDEX syntax on the target file, so the above rules no longer apply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top