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.
If you put a define in the master and recurse with the join below then you get
FILE=equipment_functional, SUFFIX=SQLORA, REMARK='Equipment Functional'
SEGNAME=EQUIPMENT_FUNCTIONAL, SEGTYPE=S0, $
FIELD=EQF_CONTRACT, ALIAS=CONTRACT, USAGE=A5, ACTUAL=A5, $
FIELD=EQF_MCH_CODE, ALIAS=MCH_CODE, USAGE=A100, ACTUAL=A100, DESCRIPTION='Object ID',TITLE='Object,ID',MISSING=ON, $
$ These defines disabled since they cause problems in recursive joins - issue manually if necessary
$ DEFINE EQF_MCH_KEY/A105 = EDIT(EQUIPMENT_FUNCTIONAL.EQF_CONTRACT,'99999') | EQUIPMENT_FUNCTIONAL.EQF_MCH_CODE ;, TITLE='Equipment,Object,Key', DESCRIPTION='Equipment Object Key', $
This is the error
(FOC104) DEFINE IN MASTER REFERS TO A FIELD OUTSIDE ITS SCOPE: EQF_MCH_KEY
0 ERROR AT OR NEAR LINE 208 IN PROCEDURE ALLSERVERFOCEXEC *
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED:
EQUIPMENT_FUNCTIONAL.EQF_CONTRACT
(FOC101) ERROR IN DEFINE IN MASTER FILE: EQUIPMENT_FUNCTIONAL
As you can see I tried to qualify the segment and this does not resolve the problem or does it work without.
This works with the define removed from the master so it must be creating the define in the renamed J1 segment and confusing itself
JOIN EQF_CONTRACT AND EQF_SUP_MCH_CODE IN EQUIPMENT_FUNCTIONAL TO EQF_CONTRACT AND EQF_MCH_CODE IN EQUIPMENT_FUNCTIONAL AS J1
DEFINE FILE equipment_functional
EQF_MCH_KEY/A105 = EDIT(EQUIPMENT_FUNCTIONAL.EQF_CONTRACT,'99999') | EQUIPMENT_FUNCTIONAL.EQF_MCH_CODE ;
END
TABLE FILE equipment_functional
PRINT *
END
So dont use defines in masters that contain hierarchies.This message has been edited. Last edited by: hammo1j,
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006
I am not surprised: when you have a recursive JOIN, then the DEFINES in the MASTER would be replicated and the lower one would then not point to the segment where it is defined. You could try to do away with the prefix:
You are right that the problem is with the defiine replicated in the lower segment, but there is no rule that says a define has to refer to fields in its own segment - I have some in non recursive clusters and they work.
In theory the replicated define should just refer to the parent and not cause a problem.
Taking the prefix off does not resolve the problem but as always thanks for your input.
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006
The cause of the problem is that, for recursive JOINs, WebFOCUS prefixes the fields in the second file with the AS name. So, fields in the joined file become J1EQF_CONTRACT and J1EQF_MCH_CODE. This allows you to reference fields in both segments without ambiguity. Issue the JOIN then CHECK FILE equipment_functional PICT to see this.
The DEFINE in the second, recursed segment fails because it does not reference the renamed fields.
The solution to this is to use TAG in the JOIN:
JOIN EQF_CONTRACT AND EQF_SUP_MCH_CODE IN EQUIPMENT_FUNCTIONAL TO EQF_CONTRACT AND EQF_MCH_CODE IN EQUIPMENT_FUNCTIONAL TAG XX AS J1
The TAG value overrides the AS name. You can reference fields in the JOINed segment by prefixing the fields with the tag value, a period, and the fieldname, for example: XX.EQF_CONTRACT.
Issue TABLE FILE filename, then ?F, to see how the fields are renamed.
A more complicated way is to code the cross-reference directly into the Master, where you can rename the fields for the second segment.
Using the newer TAG works although I dont agree with your reasoning as to why the join prefix does not work since it is perfectly possible to refer to a field in a define in the master outside its own segment in a cluster.
Never mind TAG works better than AS!
Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2 Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006