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     [SOLVED? not so fast] simple -GOTO not working

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED? not so fast] simple -GOTO not working
 Login/Join
 
Guru
posted
Hi All,
I have a simple fex in the repository which runs but does not follow the -GOTO statements. It tries to run the first -INCLUDE, no matter what.

Does anyone have an explanation and/or work-around?
Note: these focexecs, -INCLUDEd, do not have to exist to see the issue. Just run this code from somewhere in the repository.

-SET &ECHO='ALL';
 
-GOTO CAR2
 
-CAR1
-GOTO runRptEnd
-INCLUDE IBFS:/WFC/Repository/TEST/CAR1.fex
-GOTO runRptEnd
-*
 
-CAR2
-*INCLUDE IBFS:/WFC/Repository/TEST/CAR2.fex
-GOTO runRptEnd
 
-runRptEnd


The output, I see, is that CAR1.fex cannot be found when this code should never be executed.

What am I missing?

Thanks.

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



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
 
Posts: 274 | Location: Boston/New England | Registered: February 12, 2006Report This Post
Virtuoso
posted Hide Post
Always put semicolon after GOTO, such as
-GOTO CAR2;


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Expert
posted Hide Post
Never put a semi-colon after a -GOTO!

-MRNOEDIT -INCLUDE etc...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Guru
posted Hide Post
It's working fine, but you do need an existing fex to be included:

-SET &ECHO='ALL';
 
-GOTO CAR2
 
-CAR1
-GOTO runRptEnd
-TYPE 1
-GOTO runRptEnd
-*
 
-CAR2
-TYPE 2
-GOTO runRptEnd
 
-runRptEnd


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
 
Posts: 454 | Location: Europe | Registered: February 05, 2007Report This Post
Guru
posted Hide Post
Thanks Tom. That was it!



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
 
Posts: 274 | Location: Boston/New England | Registered: February 12, 2006Report This Post
Expert
posted Hide Post
I think the -MRNOEDIT will allow for a non-existing included file.

WebFOCUS Release 8.0 Version 08 > Business Intelligence Portal > Advanced Coding Techniques and Coding Considerations > Ignoring Code in a Procedure (FEX)


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
Guru
posted Hide Post
It seems that there is more to this story than I first understood. It's multi-layered. Autoprompt adds another layer.

If the '-INCLUDED' focexec has a -DEFAULT with autoprompt set on then this program will run even if there is a -GOTO to skip this code. There can be no -MRNOEDIT on the line for the included repository focexec for it to run!
But the -MRNOEDIT must be there if this code is to be ignored even when there is a -GOTO to skip it.

If there is no autoprompt then the included program will be ignored as expected as long as there is no -MRNOEDIT. But with -MRNOEDIT the focexec will not be found.


carreport.fex
-GOTO CAR1
 
-CAR1
-GOTO runRptEnd

-MRNOEDIT -INCLUDE IBFS:/WFC/Repository/TEST/carrpt.fex
-GOTO runRptEnd
 
-CAR2
-MRNOEDIT -INCLUDE IBFS:/WFC/Repository/TEST/CAR2.fex
-GOTO runRptEnd
 
-runRptEnd



carrpt.fex
  
-*-DEFAULT &COUNTRY=_FOC_NULL
TABLE FILE CAR
BY COUNTRY
BY CAR
BY MODEL
-*WHERE COUNTRY EQ '&COUNTRY.EVAL'
ON TABLE PCHOLD AS 'CARXML' FORMAT HTML
END


To see the behavior I'm seeing comment and uncomment the 2 lines in carrpt.fex for the default and where clauses.

My conclusion: -MRNOEDIT hides the line of code, which is fine if you want to skip around the code. But if you want to run the code then there can be no -MRNOEDIT for the included code.

Thanks.



Greg



current client: WF 8.1.05 & 8.2 - Windows 7 64bit - Tomcat 7 - MRE / BID - IE11

local: WF 8.2 - Windows 7 64bit - Tomcat 6 - MRE / BID - FOCUS - IE11

PMF 8
 
Posts: 274 | Location: Boston/New England | Registered: February 12, 2006Report This Post
Expert
posted Hide Post
Hi Greg,
Glad you figured it out, I think. -MRNOEDIT doesn't actually hide the code, doesn't parse it unless it hits. Which is why we put ALL out INCLUDEd programs in an App folder, that is on the APP PATH, so as not to have multiple copies.

This is exact code in MRE, and, is bracketde with -MRNOEDIT BEGIN and END, and, is in PROD...

  
-* File fin_po_inv_pgm_call.fex
-********************************
-MRNOEDIT BEGIN
-DEFAULTH &VEND_DESC = 'FOC_NONE', &REPORT = '1', &FMT = 'PDF', &FROM_DT = '01/01/2011', &TO_DT = '06/30/2011', &DATEMtrDYY = ''
-DEFAULTH &COUNT = 0, &TOT_DOLS = 0, &INV_CNT = 0, &INV_DOLS = 0, &PG_BRK = '', &HDR_FY = '', &QT = '', &X_VEND = ''

APP PREPENDPATH FOCUS_DBS
-RUN
-SET &FEX     = &FOCFEXNAME;
-INCLUDE wf_stats_start.fex
-********************************
-SET &ECHO=ALL;
-INCLUDE fin_po_inv_dateparm.fex
-SET &XFROM = IF &F_DATE EQ '' THEN '' ELSE &F_DATE;
-SET &XTO   = IF &T_DATE EQ '' THEN '' ELSE &T_DATE;
-TYPE &XFROM
-TYPE &XTO
-* EXIT
-IF &REPORT  EQ '9' OR '12' OR '13' GOTO SKIP_HTML;
-IF &FROM_DT EQ '' AND &TO_DT EQ '' GOTO DO_BOTH;
-IF &FROM_DT EQ ''                  GOTO DO_FROM;
-IF &TO_DT   EQ ''                  GOTO DO_TO;
-IF &XTO LT &XFROM                  GOTO BAD_DATES;
-SKIP_HTML
-SET &RUN_RPT = 'REPORT_' || &REPORT;
-SET &FMT = IF &FMT EQ 'EXL2K' THEN 'XLSX' ELSE &FMT;
-******************************
-GOTO &RUN_RPT
-******************************
-* 1. Socio-Economic Report
-REPORT_1
-INCLUDE fin_po_inv_1_od_new
-GOTO EOJ_PO_INV
-******************************
-* 2. Purchase Order Only
-REPORT_2
-INCLUDE fin_po_inv_2_od
-GOTO EOJ_PO_INV
-******************************
-* 3. Invoice Only
-REPORT_3
-INCLUDE fin_po_inv_3_od_new
-GOTO EOJ_PO_INV
-******************************
-* 4. Procurement Compound Report
-REPORT_4
-INCLUDE fin_pdis_compound_pdf
-GOTO EOJ_PO_INV
-******************************
-* 5. Purchase Order Listing
-REPORT_5
-INCLUDE fin_pdis_04
-GOTO EOJ_PO_INV
-******************************
-* 6. Purchase Order by Date
-REPORT_6
-INCLUDE fin_pdis_05
-GOTO EOJ_PO_INV
-******************************
-* 7. Purchase Order Department and Date
-REPORT_7
-INCLUDE fin_pdis_06
-GOTO EOJ_PO_INV
-******************************
-* 8. Purchase Order by Vendor
-REPORT_8
-INCLUDE fin_pdis_07
-RUN
-GOTO EOJ_PO_INV
-******************************
-* 9. Vendor Listing
-REPORT_9
-INCLUDE fin_pdis_08
-GOTO EOJ_PO_INV
-******************************
-* 10. Geographical Summary
-REPORT_10
-INCLUDE fin_pdis_09
-GOTO EOJ_PO_INV
-******************************
-* 11. Geographical Detail
-REPORT_11
-INCLUDE fin_pdis_10
-GOTO EOJ_PO_INV
-******************************
-* 12. Vendors Missing Tax ID
-REPORT_12
-INCLUDE fin_tax_id_missing
-GOTO EOJ_PO_INV
-******************************
-* 12. Vendors Not Categorized
-REPORT_13
-INCLUDE fin_pdis_not_categorized
-GOTO EOJ_PO_INV
-******************************
-DO_BOTH
-******************************
-HTMLFORM BEGIN
</br>
<b>Please select date range parameters, FROM and TO dates </br>
</br>
Thank you.</br> </br> </b>
-HTMLFORM END
-******************************
-GOTO EOJ_PO_INV
-******************************
-******************************
-DO_FROM
-******************************
-HTMLFORM BEGIN
</br>
<b>FROM date parameter is missing, please select a FROM date </br>
</br>
Thank you.</br> </br> </b>
-HTMLFORM END
-******************************
-GOTO EOJ_PO_INV
-******************************
-******************************
-DO_TO
-******************************
-HTMLFORM BEGIN
</br>
<b>TO date parameter is missing, please select a TO date  </br>
</br>
Thank you.</br> </br> </b>
-HTMLFORM END
-******************************
-GOTO EOJ_PO_INV
-******************************
-BAD_DATES
-******************************
-HTMLFORM BEGIN
</br>
<b>TO date must be greater than the FROM date, please try again...  </br>
</br>
Thank you.</br> </br> </b>
-HTMLFORM END
-******************************
-EOJ_PO_INV
-******************************
-INCLUDE wf_stats_end.fex
-MRNOEDIT END
-EXIT


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by gregv:
. . .
The output, I see, is that CAR1.fex cannot be found when this code should never be executed.

What am I missing?


This:

There is a pre-scan which turns any "-INCLUDE" referring to a file in repository into a -INCLUDE of a temporary copy stored on the Reporting Server. That happens even if the -INCLUDE is preceded by a -GOTO that makes it unreachable when the fex is executed on the RS. If CAR1.fex is not found where you point in the repository, an error message will result, because the pre-scan's responsibility to upload the file to RS is stymied.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
FYI

The only time you should use a semicolon after a GOTO is if it is part of an IF statement. This is because the IF statement needs the semicolon.


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
Master
posted Hide Post
I'm always told...


includes are handled first. Then all other dialog commands.

So even if the code isn't "touched" it is included before all IF's are handled.


_____________________
WF: 8.0.0.9 > going 8.2.0.5
 
Posts: 668 | Location: Veghel, The Netherlands | Registered: February 16, 2010Report This Post
Virtuoso
posted Hide Post
quote:
includes are handled first. Then all other dialog commands.


Obviously so when Autoprompt is turned on -- then RS must run a pre-scan of the code to uncover any uninitialized amper vars, and in the process must expand all -INCLUDE's.

But I don't think that is so if Autoprompt is off: When the fex is executed, the process (of walking through the code and filling up FOCSTACK) is strictly serial.
-- How else could the results of TABLE ... SAVE be included downstream?
-- Similarly for "-INCLUDE &somefile.EVAL"


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Expert
posted Hide Post
When the code is in the repository, I think the pre-scan is done by the client.

It scans for -INCLUDEs (all of them bar -MRNOEDIT), and then scans for amper variables not -SET or -DEFAULTed


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
Virtuoso
posted Hide Post
Maybe this will clear things a bit.

Altogether, four separate code-scan engines operate on the code, when a fex residing in Repository is run.

1. Client scans the fex code (a "static" code analysis), retrieves any other Repository fex files it references, converts those -INCLUDE statements into Server-side -INCLUDE statements, packages it all, and hands it to Server.

2. Server performs the Autoprompt scan (also a static analysis), unless Autoprompt is suppressed.

Server then manages a tag-team affair to run the script, alternating between...

3. The Dialog Manager execution of the code. This engine understands and executes dialog manager directives (-IF, -SET, -GOTO, -!, etc.), and performs amper var recognition, evaluation and substitution; but it does not comprehend Focus commands -- it just stacks those lines (net of substitution) for execution by #4

... and ...

4. The execution of the Focus command stream that #3 has placed in FOCSTACK. This engine is the one that executes Focus reporting language; it should not encounter any DM directive lines or amper var references -- and if it did, it would treat them literally: as far as it's concerned, "-" in column 1, and "&" anywhere, have no particular significance.

Architecturally, it's not pretty -- reminds me of the Main House at a summer camp I attended long ago, a "house designed in stages". But it generally does the job.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report 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     [SOLVED? not so fast] simple -GOTO not working

Copyright © 1996-2020 Information Builders