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] -IF THEN call a -SET command?

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] -IF THEN call a -SET command?
 Login/Join
 
Master
posted
So it's pretty simple, so it seems.. I've never done the following and I can't find any examples of this type of behavior, so I'm wondering if this is even possible. I have the following code at the top of a fex chart.

-DEFAULT &PORT_SUMRY_TYPE = 'Conforming';
-DEFAULT &NONCONFORMFLAG = 0;

-IF(&PORT_SUMRY_TYPE EQ 'Conforming') THEN
-SET &NONCONFORMFLAG = 0;
-IF(&PORT_SUMRY_TYPE EQ 'Non-Conforming') THEN
-SET &NONCONFORMFLAG = 4;
-IF(&PORT_SUMRY_TYPE EQ 'Home Equity') THEN
-SET &NONCONFORMFLAG = 1;


With everything commented out I get the following error..

0 ERROR AT OR NEAR LINE      9  IN PROCEDURE LoanCountByInvestorByMonth
 (FOC303) CONTROL LINE NOT RECOGNIZED IN FOCEXEC: -IF(&PORT_SUMRY_TYPE EQ
 'Conforming') THEN

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



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Virtuoso
posted Hide Post
The IF ... THEN ... ELSE clause goes within the -SET command.

-SET &myVar = IF ( some condition ) THEN some_value
- ELSE IF ( another condition ) THEN a different value
- ELSE another value;


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
Hi Gavin,

Place your IFs within your dialogue manager -SET statement -

-SET &NONCONFORMFLAG = IF(&PORT_SUMRY_TYPE EQ 'Conforming') THEN 0
-                 ELSE IF(&PORT_SUMRY_TYPE EQ 'Non-Conforming') THEN 4
-                 ELSE IF(&PORT_SUMRY_TYPE EQ 'Home Equity') THEN 1 ELSE 99;

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
Another example using DECODE ...

-*
-DEFAULT &PORT_SUMRY_TYPE = 'Conforming';
-*
-SET &NONCONFORMFLAG = DECODE &PORT_SUMRY_TYPE (
- 'Conforming' 0
- 'Home Equity' 1
- 'Non-Conforming' 4
- ELSE 99
-);
-*
-TYPE PORT_SUMRY_TYPE -------- &PORT_SUMRY_TYPE
-TYPE NONCONFORMFLAG --------- &NONCONFORMFLAG
-*


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Master
posted Hide Post
You guys rock.. This syntax is kicking my @$$. I swear C++ was easier.



- FOCUS Man, just FOCUS!
-----------------------------
Product: WebFOCUS
Version: 8.1.04
Server: Windows 2008 Server
 
Posts: 578 | Registered: October 01, 2014Report This Post
Platinum Member
posted Hide Post
It gets easier after 20 years or so.


WebFOCUS 7.7.05 (Someday 8)
Windows 7, All Outputs
In Focus since 1983.
 
Posts: 103 | Registered: April 27, 2011Report This Post
Master
posted Hide Post
....or

if you need to SET more than one parameter
-IF &VALUE EQ 1 THEN CONTINUE ELSE GOTO ENDIF_VALUE_1;
-SET &PARAM... = 
-SET &PARAM... = 
-SET &PARAM... = 
...
-ENDIF_VALUE_1

-IF &VALUE EQ 2 THEN CONTINUE ELSE GOTO ENDIF_VALUE_2;
-SET &PARAM... = 
-SET &PARAM... = 
-SET &PARAM... = 
...
-ENDIF_VALUE_2

-IF &VALUE EQ 3 THEN CONTINUE ELSE GOTO ENDIF_VALUE_3;
-SET &PARAM... = 
-SET &PARAM... = 
-SET &PARAM... = 
...
-ENDIF_VALUE_3


Greets,
Dave


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Virtuoso
posted Hide Post
quote:
-IF &VALUE EQ 1 THEN CONTINUE ELSE GOTO ENDIF_VALUE_1;

Thanks Dave,
Never used CONTINUE in 33 years of FOCUS!
Which goes to show that one should read and re-read (and re-read...) the manual.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report 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] -IF THEN call a -SET command?

Copyright © 1996-2020 Information Builders