Focal Point
[SOLVED] ERROR using –INCLUDE in a TABLE REQUEST.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/3477002886

November 01, 2017, 12:57 PM
Tomsweb
[SOLVED] ERROR using –INCLUDE in a TABLE REQUEST.
I put together an example of using –INCLUDE in a TABLE REQUEST.

I have been getting errors with this and I am not seeing what I may have missed.

I would really appreciate any feedback.
Here is my code...

  
-SET &ECHO = ALL;
SET ASNAMES=ON

-SET &OPT = 1;

-TYPE OPT = &OPT

-SET &WHCHFEX = IF &OPT EQ 1 
-THEN 'IBFS:/WFC/Repository/Puppies/~thomas.fxxx/Fxxx/EURORC.fex' 
-ELSE 'IBFS:/WFC/Repository/Puppies/~thomas.fxxx/Fxxx/ASIARC.fex';

-TYPE WHCHFEX = &WHCHFEX
-EXIT 

TABLE FILE CAR
PRINT CAR MODEL RETAIL AS 'RETAIL' DEALER AS 'DEALER'
  AND COMPUTE PROFIT/D7 = RETAIL - DEALER;
BY COUNTRY

-INCLUDE &WHCHFEX.EVAL

END
-RUN
-EXIT



Here is the error message.

" Error
Names cannot contain any of the following characters: Space&*()|\:;",?/ "

Double quotes are mine...

This message has been edited. Last edited by: FP Mod Chuck,


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
November 01, 2017, 01:09 PM
Tom Flynn
Try
-MRNOEDIT -INCLUDE &WHCHFEX.EVAL


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
November 01, 2017, 01:13 PM
Doug
Tom Flynn's code will work, and that's NOEDIT.

You cannot use a variable in a -INCLUDE.
November 01, 2017, 01:32 PM
Tomsweb
I changed "-INCLUDE &WHCHFEX.EVAL" to "-MRNOEDIT -INCLUDE &WHCHFEX.EVAL"

It ran successfully and displayed report output.
However when it runs the ASIARC.fex it contains this "WHERE COUNTRY EQ 'JAPAN';"

However I get the error below...


-INCLUDE IBFS:/WFC/Repository/Puppies/~thomas.fxxx/Fxxx/ASIARC.fex
(FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND: ASIARC.fex

END
-RUN
0 NUMBER OF RECORDS IN TABLE= 18 LINES= 18
0 HOLDING HTML FILE ON PC DISK ...

-EXIT

Here is the code in the ASIARC.fex, which is only 1 line:

WHERE COUNTRY EQ 'JAPAN';

How can I get the focexec to pick up the icluded file ?


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
November 01, 2017, 01:43 PM
Tom Flynn
Published?


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
November 01, 2017, 01:49 PM
Tomsweb
 
-SET &ECHO = ALL;
SET ASNAMES=ON

-SET &OPT = 1;

-TYPE OPT = &OPT

-SET &WHCHFEX = IF &OPT EQ 2
-THEN 'IBFS:/WFC/Repository/Puppies/~thomas.fxxx/Fxxx/EURORC.fex' 
-ELSE 'IBFS:/WFC/Repository/Puppies/~thomas.fxxx/Fxxx/ASIARC.fex';

-TYPE WHCHFEX = &WHCHFEX

TABLE FILE CAR
PRINT CAR MODEL RETAIL AS 'RETAIL' DEALER AS 'DEALER'
  AND COMPUTE PROFIT/D7 = RETAIL - DEALER;
BY COUNTRY

-MRNOEDIT -INCLUDE &WHCHFEX.EVAL

END
-RUN
-EXIT 

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


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
November 01, 2017, 02:11 PM
Tony A
quote:
You cannot use a variable in a -INCLUDE.

Actually Doug, you can, but you need the .EVAL

quote:
Published?

Don't think so Tom as the syntax implies a User folder (the tilde character).

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 
November 01, 2017, 02:11 PM
Doug
Are "Puppies" and "~thomas.fxxx" really part of the fully qualified path (FQP)?
November 01, 2017, 02:13 PM
Doug
Thanks Tony,
quote:
Actually Doug, you can, but you need the .EVAL
I like it Smiler

You probably covered this in your "We Can Do That In WebFOCUS" presentation at Summit, right? Smiler
November 01, 2017, 02:15 PM
Tony A
@Tomsweb,

The usual suggestion, which I am sure you've already done, is to right click the fex in question and look at the properties to get Dougs "FQP". Wink

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 
November 01, 2017, 02:16 PM
BabakNYC
I was pretty sure -MRNOEDIT is when you want to include a fex from the server app directory not from the repository. I think based on the name in this example the included focexec (IBFS:/WFC/Repository/Puppies/~thomas.fxxx/Fxxx/EURORC.fex) is in the repository.


WebFOCUS 8206, Unix, Windows
November 01, 2017, 03:09 PM
j.gross
It used to be the case that an -INCLUDE directive for a repository fex file cannot contain amper variables. As far as I know, that is still the case.

The reason involves the interplay of Client and Server:

The lookup of the fex in repository occurs within Cient; the -INCLUDE is never seen in that form by the Server. And Client has no clue what to do with "&WHCHFEX.EVAL"; at that point it probably leaves it to be passed to Server as is, and of course Server (after the amper substitution) cannot find the fex (since it has no access to repositiry).

You need to have separate -INCLUDE directives for each of the fex files, each explicitly naming the fex file and its location within Repository -- and provide -GOTO logic to send control to the -INCLUDE that matches the amper variable, when executed on Server. (By the time Server sees the request, each of the fex files will have been uploaded to Server as a temporary file, and each of the -INCLUDE lines will have been rewritten to refer to the corresponding temp file on the server).


- Jack Gross
WF through 8.1.05
November 01, 2017, 04:56 PM
Tomsweb
Hi guys, thank you for your help.

I made some changes to the fex, and it is posted below:


  
-SET &ECHO = ALL;

-SET &OPT = 1;

-TYPE OPT = &OPT

-SET &WHCHFEX = IF &OPT EQ 1 
-  THEN '-INCLUDE EURORC.fex' 
-  ELSE '-INCLUDE JAPANRC.fex'; 

TABLE FILE CAR
PRINT CAR MODEL RETAIL AS 'RETAIL' DEALER AS 'DEALER'
  AND COMPUTE PROFIT/D7 = RETAIL - DEALER;
BY COUNTRY

&WHCHFEX.EVAL

END


It runs now but I get a report with every country not the select few
that I would expect to see if the –INCLUDE(D) Where statement were recognized and executed.

Yes, BabakNYC, thank you for pointing out that the EURORC.fex and
ASIARC.fex are resting cozy and warm in the repository.

But as you say Jack Gross, it appears that the –INCLUDE is never seen
by the server. Per your reference to having “separate –INCLUDE
directives for each fex file (w/ –GOTO logic, could you provide
a basic example?

It is very interesting that –INCLUDE functionality in FOCUS has been
around since at least the 1980’s, but client server technology serves
as the albatross.


Thank you


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
November 01, 2017, 05:11 PM
David Briars
quote:
...Per your reference to having “separate –INCLUDE
directives for each fex file (w/ –GOTO logic, could you provide
a basic example?...

Each of the following has examples:
http://forums.informationbuild...1057331/m/6787093686
http://forums.informationbuild...017011386#7017011386

This message has been edited. Last edited by: David Briars,
November 01, 2017, 06:30 PM
Doug
quote:
Per your reference to having “separate –INCLUDE directives for each fex file (w/ –GOTO logic, could you provide a basic example?
That also makes if very manageable for those who come behind us... Or, for us when we come back to it years later Smiler

My suggestion exactly Smiler

-IF A EQ B THEN GOTO AEQB ELSE GOTO ANEB;

-AEQB 
-INCLUDE AEQB.fex 
-GOTO TheEnd ;

-* More code

-ANEB
-INCLUDE ANEB.fex
-GOTO TheEnd ;

-* More code
-TheEnd
-RUN
-TYPE Good Bye.





   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
November 02, 2017, 10:12 AM
Tomsweb
-SET &ECHO=ALL;

-SET &OPT = 1;

TABLE FILE CAR

PRINT
CAR MODEL RETAIL DEALER SALES
COMPUTE PROFIT/D7 = RETAIL - DEALER;
BY COUNTRY

-IF &OPT EQ 1
- THEN AEQB
- ELSE ANEB ;

-AEQB
-INCLUDE EURORC.fex
-GOTO THE_END

-*

-ANEB
-INCLUDE JAPANRC.fex

-THE_END

END
-RUN

EURORC.fex contains the line:
WHERE COUNTRY EQ 'ENGLAND' OR 'FRANCE' OR 'ITALY' OR 'W GERMANY';


JAPANRC.fex contains the line:
WHERE COUNTRY EQ 'JAPAN';


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
November 02, 2017, 10:47 AM
j.gross
An obvious caveat: The GUI's editor will totally choke on a TABLE request that encompasses dialog manager (-GOTO or -INCLUDE) directives, or even labels. So if policy requires GUI-editor compatibility, you cannot go there.

In the case of simple WHERE phrases, you can achieve the effect (within the bounds of GUI-accepted syntax) using &vars that evaluate to a target value-list or _FOC_NULL.


- Jack Gross
WF through 8.1.05