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.
TABLE FILE CAR
PRINT CAR
WHERE CAR EQ 'BMW'
ON TABLE HOLD AS HCAR FORMAT ALPHA
END
-RUN
-READFILE HCAR
-IF &CAR EQ 'BMW' GOTO LBL_BMW ELSE GOTO LBL_EXIT;
-LBL_BMW
-TYPE YIPPIE, I HAVE A &CAR
-GOTO LBL_FINITO
-LBL_EXIT
-TYPE SHUCKS, I HAVE A &CAR
-LBL_FINITO
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
TABLE FILE CAR
PRINT CAR
WHERE CAR EQ 'BMW'
ON TABLE HOLD AS HCAR FORMAT ALPHA
END
-RUN
-READFILE HCAR
-IF &CAR.EXISTS EQ 0 GOTO LBL_NOCAR;
-IF &CAR EQ 'BMW' GOTO LBL_BMW ELSE GOTO LBL_EXIT;
-LBL_BMW
-TYPE YIPPIE, I HAVE A &CAR
-GOTO LBL_FINITO
-LBL_EXIT
-TYPE SHUCKS, I HAVE A &CAR
-GOTO LBL_FINITO
-LBL_NOCAR
-TYPE AWWW, I HAVE NO CAR
-GOTO LBL_FINITO
-LBL_FINITO
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
I often find it simpler to move the test to the TABLE request and just check with &LINES whether we had any results or not.
TABLE FILE CAR
SUM FST.CAR
WHERE CAR EQ 'BMW';
END
-RUN
-IF &LINES GT 0 THEN GOTO LBL_BMW ELSE GOTO LBL_EXIT;
BTW, you don't need a LBL_EXIT, you can use EXIT as a label and the code will re-evaluate that label and find that it's also an -EXIT command.
That implies that you can't use EXIT conditionally unless you put the "label" somewhere in your code. It also implies that you shouldn't call -EXIT more than once in your procedure, since labels are supposed to be unique - fortunately, that requirement is not true for -EXIT.
I'm pretty certain that any computer science student putting that in their language design course test would fail their test, but in a commercial product apparently anything goes. If I understand correctly, it's considered "cool" to unnecessarily re-evaluate lines of code. I find that slightly humorous.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :