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     using IF in record selection

Read-Only Read-Only Topic
Go
Search
Notify
Tools
using IF in record selection
 Login/Join
 
Platinum Member
posted
I'm trying to make different selection critia based on report type. I've tested this out with the following CAR file code and I'm getting the following error message:
0 ERROR AT OR NEAR LINE 8 IN PROCEDURE ADHOCRQ FOCEXEC *
(FOC261) EXPRESSION IS INCOMPLETE BECAUSE AN OPERATION

Here's the code I'm trying to use:
-SET &RPT_TYPE = 'SELECTED';

TABLE FILE CAR
PRINT
CAR
MODEL
BODYTYPE
BY COUNTRY
-IF &RPT_TYPE EQ 'SELECTED' THEN GOTO OPT1 ELSE GOTO OPT2
-OPT1
WHERE COUNTRY EQ 'ENGLAND';
-GOTO FIN1
-OPT2
WHERE COUNTRY NE 'ENGLAND';
-GOTO FIN1
-FIN1
ON TABLE HOLD AS HCAR FORMAT FOCUS
END


Any help is appreciated.
-Bethany
WF 7.1.3


Server Environment: Win2K3 Server WebFOCUS 7.13 Apache Tomcat standalone application server
 
Posts: 188 | Registered: April 14, 2005Report This Post
<Tim Howard_ABCBS>
posted
Try ending your if statement with a semicolon (Wink.

-IF &RPT_TYPE EQ 'SELECTED' THEN GOTO OPT1 ELSE GOTO OPT2;
 
Report This Post
Platinum Member
posted Hide Post
THANKS! I knew I was missing something obvious!


Server Environment: Win2K3 Server WebFOCUS 7.13 Apache Tomcat standalone application server
 
Posts: 188 | Registered: April 14, 2005Report This Post
Expert
posted Hide Post
Bethany
just a note to add to what Tim has already taught you.
ALL your GOTO statements must end with a ;
Any DM command ends in a ;
A label, however, doesn't end with a ;
Ending a focus IF or WHERE statement with a semi is something that must come from a new gui, it makes hand-coding developers freak, we'ld always leave it off. Wink

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




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
<RickW>
posted
I don't recall ever using ; on -GOTO'S for the various platforms I've worked on over the years with FOCUS and WebFOCUS - but - I think it certainly can't hurt as long as the parser engine doesn't barf on it.

My guess is that since the GOTO DM command can only accept/expect one value (i.e. a label) following the command they don't require the semi-colon. Kind of like the -EXIT, -QUIT, etc DM commands.
 
Report This Post
Expert
posted Hide Post
Rick,

To my knowledge, the semi colon has always been required to terminate the -GOTO. Previous versions may not have fallen when it was missing, but it has always been a required syntax.

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
<RickW>
posted
I'm just talking about the standalone -GOTO statements - not the IF-THEN-ELSE statements. I've never used semi-colons for these.

That's the one thing that is good/bad about FOCUS is that the code can be very forgiving.
 
Report This Post
Guru
posted Hide Post
Funny, in all my years of coding with Focus and WebFOCUS on various platforms, I've never put a semi colon after a -GOTO unless it's part of the -IF statement?????



WebFOCUS 7.6.6/TomCat/Win2k3
 
Posts: 428 | Location: Springfield, MA | Registered: May 07, 2003Report This Post
Guru
posted Hide Post
I have never used a semicolon after "-GOTO label" nor does the example in the documentation from "Creating Reports 5.3" page 25-30 or "Developing Reporting Applications 5.3" page 10-21

Syntax: How to Perform Unconditional Branching

-GOTO label
.
.
.
-label [TYPE text]
page 10-58

Are there times when the semicolon is required? Does the use of the semicolon speed up processing?

Thanks


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Member
posted Hide Post
You might alternatively try the DM .EVAL technique. I just learned of this about 6 months ago and have found it very useful, especially if I need several lines of code changes for the same basic TABLE request. This keeps your main code cleaner and easier to read/modify in the future. Also easier to follow.

-SET &RPT_TYPE = 'SELECTED';
-IF &RPT_TYPE EQ 'SELECTED' THEN GOTO ENG ELSE GOTO NOENG;

-ENG
-SET &ENGLAND = 'WHERE COUNTRY EQ ''ENGLAND''';
-GOTO MAINTABLE

-NOENG
-SET &ENGLAND = 'WHERE COUNTRY NE ''ENGLAND''';

-MAINTABLE
TABLE FILE CAR
PRINT
CAR
MODEL
BODYTYPE
BY COUNTRY
&ENGLAND.EVAL
ON TABLE HOLD AS HCAR FORMAT FOCUS
END

This message has been edited. Last edited by: Robert B Clark,


Robert B. Clark -- Business Systems Analyst
Daimler Trucks North America
Phone: 503.745.7057
"There's always a better way."
IBM Mainframe zOS 8.1.05, DB2 adapter
WF 8.1.05 Hub to Sub, Self-Service, SQL Server adapter
 
Posts: 25 | Location: Portland, OR | Registered: October 13, 2006Report This Post
Expert
posted Hide Post
You've got me thinking now - and questioning my sanity Wink .... hmmmm
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Expert
posted Hide Post
moi aussi
dropping a semi requirement would be code loosening, not code tightening, imho




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
<RickW>
posted
Where exactly does it say it's a requirement?

It's not in the 7.x documentation or even the Focus Six for Windows that we have.
 
Report This Post
Expert
posted Hide Post
I think people have to many EVAL cards in their back pocket! You don't need an EVAL for this piece of code.

I just tried it without and it worked just fine.

As for -GOTO requiring a semi-colon, I just scanned my arsenal of fexes and found that only 832 out of 6725 -GOTO statements had semi-colons (most of the programs that used a semi-colon I didn't write).


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
After questioning my sanity, I realised that I generally do not use a "-GOTO" on its own (I probably have but can't think of when Frowner). I normally use it as part of a dialogue manager "-IF" statement. That MUST end with a semi colon and is probably why I would tend to use it every time. Smiler

So Tim's reply (also being the first) was spot on!

T
 
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     using IF in record selection

Copyright © 1996-2020 Information Builders