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.
WITH can only be used with real database fields, not with defined fields. In your case you specify the with-cluase to use a defined field, hence the error. Use MS_CO_NAME/A40 WITH COMPANY = DECODE COMPANY_A(MSCOMP ELSE '?'); instead. The WITH clause only specifies to Focus when to evaluate the defined field, it does not mean that it will use the field when evaluating the define. And, since COMPANY is an A3 field, and COMPANY_A is A4, you would not need to do the EDIT for COMPANY_A. Just a simple equation would be enough.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Moreover, You do not need WITH here at all. By default, the DEFINE will be attached to the lowest segment the expression references. If you want to attach it lower, you can use WITH real_field which will place the define in the segment where that field resides. There is the special case where a DEFINE is equal to a constant value - with no field references. That usually resides at the top segment - but there are some conditions when it can move ... so just be be sure, I always use WITH on constant defines to make sure it stays put!
Brian Suter VP WebFOCUS Product Development
Posts: 200 | Location: NYC | Registered: January 02, 2007
Where COMPANY is a field from your data, COMPANY_A will be evaluated when a value of COMPANY is retrieved. And as MS_CO_NAME references COMPANY_A, it will be evaluated at the same time as COMPANY_A.
The WITH fieldname is not required, except where a constant value is being defined. Then you use a real field, in your example that would be WITH COMPANY not WITH COMPANY_A, as that is a defined field not a real field.
Alan. WF 7.705/8.007
Posts: 1451 | Location: Portugal | Registered: February 07, 2007