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.
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.
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
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, 2007
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
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.
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