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
FOC261 [SOLVED]
 Login/Join
 
Member
posted
Hello All,

The following define is generating a FOC261. I can not for the life of me figure out why.

Any insight is appreciated!

DEFINE FILE TSAX_DRIVERS_TIMES
OT_105/D12.2=
IF TSAX_DRIVERS_TIMES.TSAX_DRIVERS_TIMES.OVERTIME_MINUTES EQ 0 THEN
  0
ELSE 
  IF TSAX_DRIVERS_TIMES.TSAX_DRIVERS_TIMES.ROUTE_TYPE EQ 5 THEN
    IF TSAX_DRIVERS_TIMES.TSAX_DRIVERS_TIMES.OVERTIME_MINUTES GT 630 THEN
      TSAX_DRIVERS_TIMES.TSAX_DRIVERS_TIMES.SPAN_MINUTES - 630
    ELSE 
      0
  ELSE 
    IF TSAX_DRIVERS_TIMES.TSAX_DRIVERS_TIMES.TOTAL_MINUTES GT 480 THEN 
      TSAX_DRIVERS_TIMES.TSAX_DRIVERS_TIMES.OVERTIME_MINUTES
    ELSE 
      IF SPAN_MINUTES GT 630 THEN 
        SPAN_MINUTES - 630
      ELSE 
        0;
END                          

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


WebFOCUS 7.6.11
Developer Studio on Windows XP. Server Components running on Windows Server 2003.
Excel, HTML, PDF
 
Posts: 21 | Registered: August 26, 2009Report This Post
Platinum Member
posted Hide Post
hi,

the parenthesis did the trick...
try this....

DEFINE FILE CAR
OT_105/D12.2=
IF LENGTH EQ 0 THEN 0 ELSE
IF LENGTH EQ 5 THEN
( IF RETAIL_COST GT 630 THEN
RETAIL_COST - 630
ELSE
0)
ELSE
IF RETAIL_COST GT 480 THEN
RETAIL_COST
ELSE
IF WIDTH GT 630 THEN
WIDTH - 630
ELSE
0;
END
TABLE FILE CAR
PRINT
OT_105

END
-EXIT



thanks
Sashanka


WF 7.7.03/Windows/HTML,PDF,EXL
POC/local Dev Studio 7.7.03 & 7.6.11
 
Posts: 103 | Registered: June 12, 2009Report This Post
Master
posted Hide Post
Its always preferred to use parenthesis when having nested if else loops..!!


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report This Post
Expert
posted Hide Post
Parenthesis will do the trick, as you have to tell WebFOCUS the order of evaluation, without then its just a string of commands, and IF THEN IF THEN ELSE ELSE is incorrect syntax.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Member
posted Hide Post
Thanks Severus, Enigma, and Waz!

I searched through the in-line Dev Studio help, and my printed documentation and was unable to find this type of information before posting.

Do you know if it exists? If so, would you point me to it?

What is the general pattern for using parenthesis in nested if's? Severus' example only used one set for many nested ifs.

Is it?
If then
(If then (if then else) else (if then else))
else

Thanks again!


WebFOCUS 7.6.11
Developer Studio on Windows XP. Server Components running on Windows Server 2003.
Excel, HTML, PDF
 
Posts: 21 | Registered: August 26, 2009Report This Post
Expert
posted Hide Post
Thats right.

Each result if it is nested should be in parenthesis.

you don't need parenthesis if it is just if then else if then else if then else etc.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders