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] (FOC266) IF ..THEN.. ELSE SYNTAX ERROR

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] (FOC266) IF ..THEN.. ELSE SYNTAX ERROR
 Login/Join
 
Platinum Member
posted
I am getting a syntax error message on the following IF THEN ELSE statement.

IF J1.SEG01.LICENSE EQ '' THEN J0.SEG01.NONABACARDNUMBER ELSE J1.SEG01.LICENSE

I am trying to say if the field LICENSE is null then use NONABACARDNUMBER else use LICENSE

I am new to webfocus and couldn't find a function and/or not sure how to handle the 'null' scenario in a report section of a procedure.

This message has been edited. Last edited by: <Kathryn Henning>,


WF8
Windows
 
Posts: 117 | Registered: May 28, 2015Report This Post
Master
posted Hide Post
What is the size and format of the 2 fields you're using in the if,,,then,,,else?
The field on the left if the = sign must be the same size and format of those on the right side of the = sign.

Please show us the entire line of code.


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Master
posted Hide Post
You also need to put a semicolon at the end of the expression.


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Platinum Member
posted Hide Post
Use IS MISSING for a null test.

IF J1.SEG01.LICENSE IS MISSING THEN J0.SEG01.NONABACARDNUMBER ELSE J1.SEG01.LICENSE


WF 7.6.11
Output: HTML, PDF, Excel
 
Posts: 123 | Location: UK | Registered: October 09, 2003Report This Post
Virtuoso
posted Hide Post
As Tewy points out, you can use IS MISSING to test for missing data, but you can also use the IS-NOT MISSING syntax to test that there is data present.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Expert
posted Hide Post
You might find this link of use.

You might want to check out the use of SET MISSING = ON/OFF, (also SET HOLDMISS and SET COMPMISS) and how they might change the way you check for missing values in differing data sources (e.g. RDBMS, HOLD files etc.)

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
Member
posted Hide Post
quote:
IF J1.SEG01.LICENSE EQ '' THEN J0.SEG01.NONABACARDNUMBER ELSE J1.SEG01.LICENSE

You might also want to check for blanks:

IF J1.SEG01.LICENSE EQ MISSING THEN J0.SEG01.NONABACARDNUMBER ELSE
IF J1.SEG01.LICENSE EQ ' ' THEN J0.SEG01.NONABACARDNUMBER ELSE
J1.SEG01.LICENSE
 
Posts: 15 | Location: Houston TX | Registered: March 22, 2010Report This Post
Platinum Member
posted Hide Post
Thanks folks I believe the issue is with checking from the Nonabacardnumber which is an I11 type and Licence is an A6 type. I did an FPRINT(ABACARDNUMBER,'I11','A11') to convert it and then tried the SUBSTR on that define and still couldn't get it to work. Anyone have ideas on how to convert an I11 to an A6? The field never has anything more than 6 characters in it.


WF8
Windows
 
Posts: 117 | Registered: May 28, 2015Report This Post
Expert
posted Hide Post
With FPRINT, the incoming format does not have to fully represent the actual format of the column that you are converting -

FPRINT(ABACARDNUMBER,'I6','A6')

or with leading zeroes

FPRINT(ABACARDNUMBER,'I6L','A6')

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
Platinum Member
posted Hide Post
[SOLVED]


WF8
Windows
 
Posts: 117 | Registered: May 28, 2015Report 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] (FOC266) IF ..THEN.. ELSE SYNTAX ERROR

Copyright © 1996-2020 Information Builders