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     [SOLVED] Error with IF Then Else

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Error with IF Then Else
 Login/Join
 
Member
posted
Here is my code that gives me the EXPRESSION IS INCOMPLETE BECAUSE AN OPERATION IS MISSING error. I've tried changing the || to a single | concatenation operator, but still the error persists.
DEFINE FILE HOLDFILE1

DISPLAY_NM2/A500 = 	IF CAR_NM IS NOT MISSING 
					THEN ' ['  || CAR_NM || ' - ' || ( IF SQNC_NB IS NOT MISSING THEN  BR_NB ELSE RGN_CD ) || '] ' ;

END  

Any ideas on what is missing?
Thank you!

This message has been edited. Last edited by: OnQuest,


WebFOCUS 767, Windows XP
Excel, HTML, PDF
 
Posts: 15 | Registered: March 11, 2009Report This Post
Expert
posted Hide Post
You cannot embed a second IF statement within the first one.

Try something like this instead:

DEFINE FILE HOLDFILE1
DISPLAY_NMXX/A50 = IF SQNC_NB IS NOT MISSING THEN BR_NB ELSE RGN_CD;
DISPLAY_NM2/A500 = IF CAR_NM IS NOT MISSING THEN ' [' || CAR_NM || ' - ' || DISPLAY_NMXX || '] ' ELSE '';
END


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
Here is a format with a nested IF currently in production:

  
February/P12.3CB = IF '&MO2' GE '02' THEN 
                  (IF Month EQ '02' AND VERSIONS_KEY EQ 'ACT'    THEN Amount ELSE 0)
                 ELSE
                   IF Month EQ '02' AND VERSIONS_KEY EQ 'PLAN01' THEN Amount ELSE 0;


This "may" be the syntax you are looking for...

hth


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
And you're also missing the ELSE part.
The following DEFINE should syntactically correct (did not test it):
DEFINE FILE HOLDFILE1
DISPLAY_NM2/A500 = IF CAR_NM IS MISSING THEN '?' ELSE
                   IF SQNC_NB IS NOT MISSING THEN
                   ' ['  || CAR_NM || ' - ' || BR_NB || '] ' ELSE
                   ' ['  || CAR_NM || ' - ' || RGN_CD || '] ' ;
END


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Member
posted Hide Post
Thanks Everyone.
I replaced the nested If with a define variable and also added the missing else ' ' at the end.
that worked for me.


WebFOCUS 767, Windows XP
Excel, HTML, PDF
 
Posts: 15 | Registered: March 11, 2009Report 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     [SOLVED] Error with IF Then Else

Copyright © 1996-2020 Information Builders