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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
WebFOCUS Quirk
 Login/Join
 
Gold member
posted
Has anyone else experienced the following situation? The code below is just a simple example of my DEFINE to illustrate. The actual code contains many more ORs (~50) and ELSE IFs (~7). The situation is that the first set of code below causes WebFOCUS 7.11 to bomb with an error while the second set of code, identical except that the literals 'DAFFY' and 'GOOFY' are swapped, works...at least, I think it works. The error that shows in the source after running the first set is (FOC261) EXPRESSION IS INCOMPLETE BECAUSE AN OPERATION IS MISSING. We've seen this problem a couple of times now, so I was curious if anyone knew what was going on here??? The data source is a FOC file.

1st Set
CATG/A32=IF NAME CONTAINS 'DONALD'
OR 'DAFFY' OR 'GOOFY' THEN 'DISNEY'
ELSE 'WB';

2nd Set
CATG/A32=IF NAME CONTAINS 'DONALD'
OR 'GOOFY' OR 'DAFFY' THEN 'DISNEY'
ELSE 'WB';


WF 8.1.05, Windows Server 2012 R2
 
Posts: 50 | Registered: March 26, 2004Report This Post
Expert
posted Hide Post
BBB/A32 = IF AAA CONTAINS 'C1' OR 'D1' OR 'E1' THEN 'DISNEY' ELSE 'WB';


IBI calls this a "Lazy IF" statement. The correct syntax should be:

BBB/A32 = IF AAA CONTAINS 'C1' OR AAA CONTAINS 'D1' OR AAA CONTAINS 'E1' THEN 'DISNEY' ELSE 'WB';


If the values you're testing are the complete value and not partial text in the column, you can code it like it's done in SQL:

BBB/A32 = IF AAA IN ('C1', 'D1', 'E1') THEN 'DISNEY' ELSE 'WB';


Of course, I'm not sure if this will solve the problem you're having.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Do you have an embedded quote within your data list?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
your example code should work fine... i'll vote for lazy coding any day... lets see your whole statement, i think we'ld all 3 agree that its likely there's an embedded ' somewhere




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Gold member
posted Hide Post
Here's the actual code. I had to flip-flop
'ACI SELECT BOND' with 'STATE STREET SELECT' to get it to work. I've had a couple "second sets of eyes" looking at it, and we haven't been able to spot any problems. There is an ampersand, but I tried using the pipe symbol to escape it and that didn't matter. Thanks for the responses so far.


BALCAT/A32=IF ISSUE_NAM CONTAINS 'SSF HIGH YIELD'
OR 'STATE STREET HIGH YIELD' OR 'ACI HIGH YIELD BOND'
OR 'SSF SELECT BOND' OR 'ACI SELECT BOND' OR 'STATE STREET SELECT'
OR 'SSF MUNICIPAL' OR 'STATE STREET MUNI' OR 'ACI LONG TERM TAX FREE'
OR 'MM RUSSELL CORE BOND'
OR 'MIDWESTERN MUTUAL SERIES' OR 'MM SERIES'
THEN 'PUBLIC BONDS & PFD STOCK'
ELSE IF ISSUE_NAM CONTAINS 'SSF GROWTH'
OR 'STATE STREET GROWTH STOCK' OR 'ACI SELECT'
OR 'SSF AGGRESSIVE' OR 'STATE STREET AGGR' OR 'ACI MID CAP GROWTH'
OR 'SSF INDEX' OR 'STATE STREET INDEX' OR 'ACI EQUITY INDEX' OR 'FEDERATED FU'
OR 'SSF INTERNATIONAL' OR 'STATE STREET INTERNAT' OR 'ACI INTERNATIONAL VALUE'
OR 'SSF SMALL CAP' OR 'STATE STREET SMALL'
OR 'SSF LARGE CAP' OR 'STATE STREET LARGE' OR 'ACI EQUITY GROWTH'
OR 'MUTUAL FUND SEED'
OR 'MM INDEX'
OR 'MM RUSSELL AGGRESSIVE'
OR 'MM RUSSELL MULTI'
OR 'MM RUSSELL NON-US'
OR 'MM SMALL CAP'
OR 'FRIC '
OR 'MM CAPITAL GUARDIAN' OR 'MM CAP GUARD'
OR 'MM INTERNATIONAL'
OR 'MM T ROWE ' OR 'MM T. ROWE'
OR 'MM ALLIANCE'
OR 'MM JANUS'
OR 'MM ASSET ALLOCATION'
OR 'SSF ASSET ALLOCATION' OR 'STATE STREET ASSET ALLO' OR 'ACI STRATEGIC ALLO'
THEN 'PUBLIC COMMON STOCK'
ELSE IF ISSUE_NAM CONTAINS 'MM RUSSELL REAL ESTATE'
THEN 'REAL ESTATE'
ELSE IF IP_PORT_CDE IS '101' AND SECTYPE_CDE IS ' '
THEN 'MONEY MARKET'
ELSE IF IP_PORT_CDE IS '136' AND SECTYPE_CDE IS 'CSTK' OR 'TCI'
THEN 'MONEY MARKET'
ELSE IF IP_PORT_CDE IS '136' THEN 'PUBLIC BONDS & PFD STOCK'
ELSE IF VHCL_ID IS '22207#101' THEN 'SUBS & AFFILIATES'
ELSE IF IP_PORT_CDE IS '397' THEN 'PRIVATE EQUITIES'
ELSE IF ((AS_OF_DATE LE '20040831') AND (IP_PORT_CDE EQ '403') AND
(ISSUE_NAM CONTAINS 'TODD CONS' OR 'BOSTON ART' OR 'FRANK RUSS' OR
'NETWORK PLAN' OR 'SARGASSO' OR 'BRADFORD')) THEN 'SUBS & AFFILIATES'
ELSE 'Error';


WF 8.1.05, Windows Server 2012 R2
 
Posts: 50 | Registered: March 26, 2004Report This Post
Expert
posted Hide Post
Hmmm....

I think with nested IFs to that extent I'd look at external decode files, as you have CONTAINS in there I'd include all possible values, or look at creating a file to join to obtain the field value. The advantage then would be that maintenance would be data oriented instead of coding changes.

Do you have an ISSUE_CODE that you could use to decode?

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
how many chars does 'ISSUE_NAM' have? are you sure each of your test values in less than or = to the length of the ISSUE_NAM field?
you could increment thru to find the guilty party
BALCAT/A32=IF ISSUE_NAM CONTAINS 'SSF HIGH YIELD'
OR 'STATE STREET HIGH YIELD'
OR 'ACI HIGH YIELD BOND'
OR 'SSF SELECT BOND'
OR 'ACI SELECT BOND'
OR 'STATE STREET SELECT'
OR 'SSF MUNICIPAL'
OR 'STATE STREET MUNI'
OR 'ACI LONG TERM TAX FREE'
OR 'MM RUSSELL CORE BOND'
-* comment out a bunch
THEN 'PUBLIC BONDS & PFD STOCK'
-*ELSE... comment out a bunch more
ELSE 'BURKINA FASO';

and then see which one causes the breakdown.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Gold member
posted Hide Post
Tony A, thanks for the suggestion, no ISSUE_CDE field, but we do have a vehicle key field that we could use, but I think the original author was looking for something that wasn't so discrete...using CONTAINS and so on.

susannah, ISSUE_NAM is an A30. I did play around with commenting in and out code. I narrowed it down to the order of the two names, 'ACI SELECT BOND' and 'STATE STREET SELECT'...imagine all those permutations!!! I was hoping someone else had experienced this and could offer me some reassurance that my program was indeed working and not short-circuiting. I think it's very weird that changing the order of two operands would eliminate the error I was getting. I'm inclined to think that some error may still exists, but it's no longer being caught by WebFOCUS. Regardless, my program runs without any visible errors if I'm careful to order my operands "correctly".


WF 8.1.05, Windows Server 2012 R2
 
Posts: 50 | Registered: March 26, 2004Report This Post
Guru
posted Hide Post
IB,

Have your tried adding parens ( ) in case it's a code tightening thing?

CATG/A32=IF (NAME CONTAINS 'DONALD'
OR 'DAFFY' OR 'GOOFY') THEN 'DISNEY'
ELSE 'WB';



WebFOCUS 7.6.6/TomCat/Win2k3
 
Posts: 428 | Location: Springfield, MA | Registered: May 07, 2003Report This Post
Expert
posted Hide Post
Even though the column is defined as A30 in the Master, is it possible it is a text field?, if so, perhaps this is causing something odd to happen.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
Not sure if this is related or not. We had a somewhat similar issue in version 5.3.2 as well as 7.1.4 on MVS. In our case, the order of two computes within a DEFINE block made a difference to the result. The reason I say it is similar is because your problem is also in a DEFINE. In our case, IBI identified the issue as a bug (introduced in version 5.x) and fixed it in version 7.1 service pack 7. The problem is only on MVS, not AIX


Diptesh
WF 7.1.7 - AIX, MVS
 
Posts: 79 | Location: Warren, NJ, USA | Registered: October 25, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders