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] How to code for compound IF logic

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to code for compound IF logic
 Login/Join
 
Guru
posted
I haven't been able to find info on how to code compound IF logic. Is code like the following valid?

FIELDB /P5 = IF (FIELDA GE 1 AND FIELDA LE 500) THEN FIELDA ELSE 0;

If that is not valid, then what is a valid way to code for something like this?

Thanks so much!

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


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report This Post
Master
posted Hide Post
That should be valid, you don't even need the parens. Are you having a problem with it?


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Virtuoso
posted Hide Post
As Pat asked, are you having a problem, is this in a COMPUTE or DEFINE? You can also use the syntax IF FILEDA FROM 1 TO 500 THEN FIELDA ELSE 0.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Guru
posted Hide Post
Thank you all for replying! I originally had code like this:

FIELDB /P5 = IF FIELDA (GE 1 AND LE 500) THEN FIELDA ELSE 0;

That didn't work, so I then had code like this:

FIELDB /P5 = IF (FIELDA GE 1 AND FIELDA LE 500) THEN FIELDA ELSE 0;

which also did not work, so I then wanted to try the IS_FROM logic, which does appear to work. I'll also try your suggestion, Leah.

Thanks so much again for replying and so quickly!


Mainframe FOCUS 7.0
VM/CMS and MVS/TSO
 
Posts: 250 | Registered: January 14, 2008Report This Post
Expert
posted Hide Post
No such thing as IS_FROM logic, perhaps you mean this -

FIELDB/P5 = IF FIELDA FROM 1 TO 500 THEN FIELDA ELSE 0;

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
Master
posted Hide Post
webmeister,
I just assumed that your code was in a define, if it is a compute the word COMPUTE is missing. If it is in a define what you have should work, assuming that FIELDA is numeric.

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


Pat
WF 7.6.8, AIX, AS400, NT
AS400 FOCUS, AIX FOCUS,
Oracle, DB2, JDE, Lotus Notes
 
Posts: 755 | Location: TX | Registered: September 25, 2007Report This Post
Expert
posted Hide Post
I'll occasionally use boolean logic instead of compund IFs -
FIELDB/P5 = (FIELDA FROM 1 TO 500) * FIELDA;

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
  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] How to code for compound IF logic

Copyright © 1996-2020 Information Builders