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     FOC error to use REAL FIELD with WITH clause

Read-Only Read-Only Topic
Go
Search
Notify
Tools
FOC error to use REAL FIELD with WITH clause
 Login/Join
 
Silver Member
posted
Hi

this is the defined field from a MFD

MS_CO_NAME/A40 WITH COMPANY = DECODE COMPANY(MSCOMP ELSE '?');

i want to make a change like the below:
company is a real field in MFD that holds the length of A3.

i tried the below code:
COMPANY_A/A4 = EDIT(COMPANY,'9999');
MS_CO_NAME/A40 WITH COMPANY_A = DECODE COMPANY_A(MSCOMP ELSE '?');

i get the error message:

USE REAL FIELD with the WITH clause

can any one help me to solve this error

REVA.


Focus Core 7.1.1 & 7.6.4
XP
MainFrames
 
Posts: 38 | Registered: November 20, 2007Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Virtuoso
posted Hide Post
Reva,

May I suggest you only post one question on the same topic. You'll get many answers as all here are quite willing to help.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Platinum Member
posted Hide Post
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, 2007Report This Post
Silver Member
posted Hide Post
hi all
thanks for all your replies.

do any one give me a suggestion how can i edit a field that holds the legth of A4 to A3, and also to use the converted field with the WITH clause


Focus Core 7.1.1 & 7.6.4
XP
MainFrames
 
Posts: 38 | Registered: November 20, 2007Report This Post
Virtuoso
posted Hide Post
The answer to you question has already been given.

But to clarify, in an MFD use:
DEFINE COMPANY_A/A4 = EDIT(COMPANY,'9999');$
DEFINE MS_CO_NAME/A40 = DECODE COMPANY_A(MSCOMP ELSE '?');$

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, 2007Report This Post
Silver Member
posted Hide Post
Hi all
thanks for all your replies.


Focus Core 7.1.1 & 7.6.4
XP
MainFrames
 
Posts: 38 | Registered: November 20, 2007Report 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     FOC error to use REAL FIELD with WITH clause

Copyright © 1996-2020 Information Builders