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     Goto Statement Confusions on 7.1.3

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Goto Statement Confusions on 7.1.3
 Login/Join
 
Master
posted
Hello!

I'm having trouble understanding how the GOTO statement works. I have written a few GOTO's into my code, and when the called section of code completes, the .fex seems to continue where it left off.

Here is an example of my code:
-IF &REP_GRP_ATTRIB EQ 'FOC_NONE' THEN GOTO MYFASTER ELSE GOTO MYSLOWER;

-MYFASTER
TABLE FILE MATRIX_DIV_MTD
PRINT
STORE_NAME
WHERE RECORDLIMIT EQ 10
END
-GOTO ADD_DETAILS;

-MYSLOWER
TABLE FILE MATRIX_DIV_MONTHLY
PRINT
STORE_CODE
WHERE RECORDLIMIT EQ 10
END
-GOTO ADD_DETAILS;
...
...


The problem is that it outputs the following, which suggests it is running both sections of code even though an IF statement is listed.

PAGE 1
STORE_NAME
05 CNTR-MC
01 WEST
02 CENTRAL
04 HUTCH
01 WEST
04 HUTCH
07 F D-CON
08 F D-C I
20 SALFDMI
21 SAL-F and D

PAGE 1
STORE_CODE
05
01
02
04
01
04
07
08
20
21

I've researched the GOTO statement and it seems as though it is acting like a PERFORM command in my code. I've also added a -GOTOEND in my code, and it still seems to return control to where the GOTO was called.

Please point me in the right direction.
Thanks!


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Expert
posted Hide Post
Based on my humble WF 5.3.2 knowledge:

1) Ensure that the parameter &REP_GRP_ATTRIB exists.
2) When a Dialogue Manager GOTO statement is not used in an IF statement, do not use the ending semi-colon (i.e. -GOTO ADD_DETAILS).
3) Ensure that the label ADD_DETAILS exists.
4) Add -SET &ECHO=ALL; to see the Dialogue Manager code and the -GOTO statements at work.


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
Virtuoso
posted Hide Post
Just tried on 7.1.3 myself and all works according to plan.

Francis is right in his 2., though 7.1.3 does not seem to object to the semi-colon!
If &REP_GRP_ATTRIB does not exist, I get an error as expected.
If the ADD_DETAILS label does not exist, I get expected error.
So as Francis said, try the &ECHO and let's see the results.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Expert
posted Hide Post
To ensure that Dialogue Manager branching works correctly, I would add -RUN after the END statements.

-SET &ECHO=ALL;

-IF &DATEYYMD EQ '2007/02/13' GOTO MYONE ELSE GOTO MYTWO;

-MYONE
TABLE FILE CAR
SUM 
COUNTRY
BY COUNTRY
HEADING
"MYONE"
END
-RUN
-GOTO ADD_DET

-MYTWO
TABLE FILE CAR
SUM
MODEL
BY MODEL
HEADING
"MYTWO"
END
-RUN
-GOTO ADD_DET

-ADD_DET
TABLE FILE CAR
SUM
CAR
BY
CAR
HEADING
"ADD_DETAILS"
END
-RUN


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
Master
posted Hide Post
Well, I looked into what you folks said. I added the -SET &ECHO=ALL; and it didn't change the output at all. Not sure what to expect, but I assumed some sort of play by play information...all I got was the same HTMl tables. Any ideas appreciated on that.

So, I went ahead and started to question the EQ 'FOC_NONE' part of it, and I changed the value from FOC_NONE to something else, and now it works as expected.

-IF &REP_GRP_ATTRIB EQ 'IGGY' THEN GOTO MYFASTER ELSE GOTO MYSLOWER;

Here's the lousy part, if I can't use FOC_NONE as the variable value, how can I eliminate that part of the where clause? I was counting on the FOC_NONE value to eliminate the where clauses for me. The where criteria gets kinda complex. see below:

WHERE FACILITY_CODE EQ &FACILITY_CODE.(OR(FIND STORE_NAME IN MATRIX_DIV_MTD)).FACILITY_TEST.;
WHERE STORE_CODE EQ &STORE_CODE.(OR(FIND STORE_CODE IN MATRIX_DIV_MTD)).STORE_TEST.;
WHERE CUST_CLASS_CODE EQ &CUST_CLASS_CODE.(OR(FIND STORE_NAME IN MATRIX_DIV_MTD)).CUST_CLASS_TEST.;
WHERE CUST_NUMBER EQ &CUST_NUMBER.(OR(FIND STORE_NAME IN MATRIX_DIV_MTD)).CUST_NUMBER_TEST.;
WHERE PL_NUMBER EQ &PL_NUMBER.(OR(FIND STORE_NAME IN MATRIX_DIV_MTD)).PL_NUMBER_TEST.;
WHERE GROUP_NUMBER EQ &GROUP_NUMBER.(OR(FIND STORE_NAME IN MATRIX_DIV_MTD)).GROUP_TEST.;
WHERE SUB_GROUP_NUMBER EQ &SUB_GROUP_NUMBER.(OR(FIND STORE_NAME IN MATRIX_DIV_MTD)).SUBGROUP_TEST.;
WHERE ITEM_NUMBER EQ &ITEM_NUMBER.(OR(FIND STORE_NAME IN MATRIX_DIV_MTD)).ITEMNUM_TEST.;


If I were to write an -IF statement looking for some other value that represents a FOC_NONE like 'IGGY' for example, it would probably work... but that seems like a really weak solution.

Any ideas?


Prod: Single Windows 2008 Server running Webfocus 7.7.03 Reporting server Web server IIS6/Tomcat, AS400 DB2 database.
 
Posts: 611 | Registered: January 04, 2007Report This Post
Platinum Member
posted Hide Post
When you have -SET &ECHO=ALL then right-click on your output and "view source". That will give you the "play-by-play" details you were expecting.



Production: 7.6.6 WF Server  <=>  7.6.6 WF Client  <=>  7.6.6 Dev Studio
Testing: <none>
Using MRE & BID.  Connected to MS SQL Server 2005
Output Types: HTML, Excel, PDF
 
Posts: 230 | Location: Wichita, KS | Registered: May 27, 2005Report This Post
Expert
posted Hide Post
Jason,

Why bother with the ELSE part? Just have -

-IF &REP_GRP_ATTRIB NE 'FOC_NONE' THEN GOTO MYSLOWER;

That will give you exactly what you are after.

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     Goto Statement Confusions on 7.1.3

Copyright © 1996-2020 Information Builders