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] Conditional include

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Conditional include
 Login/Join
 
Guru
posted
Hi,

When using -INCLUDE APPDIR/FEXFILENAME Everything works fine in my report
But when i define a variable like
-SET &VARNAME = IF condition THEN 'fexfilename'
ELSE 'ANOTHERFEXFILENAME' END
-INCLUDE &VARNAME
i am not able to schedule my report with report caster getting a message:
WEBFOCUS REPIORTING SERVER PROCEDURE CANNOT BE FOUND.

I am using webfocus 7.6.4.

Regards.

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


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
 
Posts: 273 | Location: Europe | Registered: May 31, 2007Report This Post
Virtuoso
posted Hide Post
quote:
-SET &VARNAME = IF condition THEN 'fexfilename' ELSE 'ANOTHERFEXFILENAME' END
-INCLUDE &VARNAME


The above should read something like:
-SET &VARNAME = IF condition THEN 'fexfilename' ELSE 'ANOTHERFEXFILENAME';
-INCLUDE APPDIR/&VARNAME.EVAL

Maybe by doing it like this it will work.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Guru
posted Hide Post
quote:
-INCLUDE APPDIR/&VARNAME.EVAL

Hi,

Thanks for your reply. It still not working and getting the same error.

Regards.


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
 
Posts: 273 | Location: Europe | Registered: May 31, 2007Report This Post
Guru
posted Hide Post
 
-SET &VARNAME = IF condition THEN 'fexfilename' 
ELSE 'ANOTHERFEXFILENAME' END
-INCLUDE &VARNAME 


instead of the above try this:

-SET &VARNAME = IF condition THEN 'fexfilename' 
-ELSE 'ANOTHERFEXFILENAME' END
-INCLUDE &VARNAME


if you are using DM you need to start every line with a - symbol (i learned this literally minutes ago.)


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
 
Posts: 285 | Location: UK | Registered: October 26, 2007Report This Post
Guru
posted Hide Post
Try this.

 
-* S = SUMMARY (CAR2)
-* D = DETAIL  (CAR1)
-SET &PULL     = S;
-* YOUR FIRST FEX
-SET &CAR1     = '/eda53/ibi/apps/dashboard/car1.fex';
-* YOUR SECOND FEX
-SET &CAR2     = '/eda53/ibi/apps/dashboard/car2.fex';
-SET &RUNFEX   = DECODE &PULL(S '&CAR2.EVAL' D '&CAR1.EVAL');
-SET &&INCLUDE = '-INCLUDE';
-TYPE &CAR1

&&INCLUDE.EVAL &RUNFEX.EVAL


Substitute the path of your fexes for &CAR1 and &CAR2.


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Expert
posted Hide Post
quote:
-SET &VARNAME = IF condition THEN 'fexfilename'
-ELSE 'ANOTHERFEXFILENAME' END
-INCLUDE &VARNAME


A Dialogue Manager statement ends with a semi-colon, not END.

You need MRNOEDIT:

  
-SET &CNTR = 2;
-SET &VARNAME = IF &CNTR EQ 1 THEN 'foldername/focexec.fex' 
-                             ELSE 'foldername/focexec.fex';
-MRNOEDIT -INCLUDE &VARNAME


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
Does the following code really work?


[CODE]
-SET &VARNAME = IF &CNTR EQ 1 THEN 'foldername/focexec.fex'
- ELSE 'foldername/focexec.fex';
[CODE]

Is the "-" used to continue the previous line?


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Guru
posted Hide Post
Posted September 04, 2008 11:43 AM Hide Post
Sorry!


-SET &VARNAME = IF &CNTR EQ 1 THEN 'foldername/focexec.fex' 
- ELSE 'foldername/focexec.fex';


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Expert
posted Hide Post
Hi Glenda,

Yes, it is to continue the previous line, AND, it really works...

Tom


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
I can't seem to make it work. Is there some secret to this?

This code
-SET &INP1 = 1;
-SET &DIR  = IF &INPUT EQ 1 THEN '/rimsi/site1/prod2' ELSE
-            IF &INPUT EQ 2 '/anicoi/site1/prod4' ELSE
-            IF &INPUT EQ 3 '/rimsi/site1/train2' ELSE
-            IF &INPUT EQ 4 '/anicodi/site1/prod2' ELSE
-            IF &INPUT EQ 5 '/anicoui/site1/prod3' ELSE
-            IF &INPUT EQ 6 '/anicoui/site1/prod4' ELSE
-            IF &INPUT EQ 7 '/rims/site1/prod1' ELSE
-            IF &INPUT EQ 8 '/modl/site1/prod1' ELSE
-            IF &INPUT EQ 9 '/rims/site1/train2' ELSE
-            IF &INPUT EQ 10 '/anicodi/site1/prod1' ELSE
-            IF &INPUT EQ 11 '/anicoui/site1/prod1' ELSE
-            IF &INPUT EQ 12 '/anicoui/site1/prod1' ELSE
-            IF &INPUT EQ 13 '/rimsm/site1/prodm' ELSE
-            IF &INPUT EQ 14 '/anicom/site1/prodm' ELSE
-            IF &INPUT EQ 15 '/rimsm/site1/prodm' ELSE
-            IF &INPUT EQ 16 '/anicodm/site1/prodm' ELSE
-            IF &INPUT EQ 17 '/anicoum/site1/prodm' ELSE '/anicoum/site1/prod4';
-SET &FDEF1        = 'FILEDEF ADJMST DISK &DIR.EVAL/adjmst';
-*SET &FDEF2       = 'FILEDEF CONTRL DISK &DIR.EVAL/contrl';
-*SET &FDEF3       = 'FILEDEF SIGNRS DISK &DIR.EVAL/signrs';
-*SET &FDEF4       = 'FILEDEF SIGNGP DISK &DIR.EVAL/signgp';
-TYPE DIR   => &DIR
-TYPE FDEF1 => &FDEF1
-EXIT


Results in this error:

(FOC261) EXPRESSION IS INCOMPLETE BECAUSE AN OPERATION IS MISSING

AND

This code:

-SET &INP1 = 1;
-SET &DIR        = DECODE &INPUT(1 '/rimsi/site1/prod2'
-                                2 '/anicoi/site1/prod4'
-                                3 '/rimsi/site1/train2'
-                                4 '/anicodi/site1/prod2'
-                                5 '/anicoui/site1/prod3'
-                                6 '/anicoui/site1/prod4'
-                                7 '/rims/site1/prod1'
-                                8 '/modl/site1/prod1'
-                                9 '/rims/site1/train2'
-                                10 '/anicodi/site1/prod1'
-                                11 '/anicoui/site1/prod1'
-                                12 '/anicoui/site1/prod1'
-                                13 '/rimsm/site1/prodm'
-                                14 '/anicom/site1/prodm'
-                                15 '/rimsm/site1/prodm'
-                                16 '/anicodm/site1/prodm'
-                                17 '/anicoum/site1/prodm'
-                                18 '/anicoum/site1/prod4');
-SET &FDEF1        = 'FILEDEF ADJMST DISK &DIR.EVAL/adjmst';
-*SET &FDEF2       = 'FILEDEF CONTRL DISK &DIR.EVAL/contrl';
-*SET &FDEF3       = 'FILEDEF SIGNRS DISK &DIR.EVAL/signrs';
-*SET &FDEF4       = 'FILEDEF SIGNGP DISK &DIR.EVAL/signgp';
-TYPE DIR   => &DIR
-TYPE FDEF1 => &FDEF1
-EXIT


Has these results:

DIR =>
FDEF1 => FILEDEF ADJMST DISK /adjmst


?????


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Expert
posted Hide Post
Hi Glenda,

Syntax error:

Shouldn't &INPUT be &INP1??

quote:

-SET &INP1 = 1;
-SET &DIR = IF &INPUT EQ 1 '/rimsi/site1/prod2' ELSE
- IF &INPUT EQ 2 '/anicoi/site1/prod4' ELSE
- IF &INPUT EQ 3 '/rimsi/site1/train2' ELSE
- IF &INPUT EQ 4 '/anicodi/site1/prod2' ELSE
- IF &INPUT EQ 5 '/anicoui/site1/prod3' ELSE
- IF &INPUT EQ 6 '/anicoui/site1/prod4' ELSE
- IF &INPUT EQ 7 '/rims/site1/prod1' ELSE
- IF &INPUT EQ 8 '/modl/site1/prod1' ELSE
- IF &INPUT EQ 9 '/rims/site1/train2' ELSE
- IF &INPUT EQ 10 '/anicodi/site1/prod1' ELSE
- IF &INPUT EQ 11 '/anicoui/site1/prod1' ELSE
- IF &INPUT EQ 12 '/anicoui/site1/prod1' ELSE
- IF &INPUT EQ 13 '/rimsm/site1/prodm' ELSE
- IF &INPUT EQ 14 '/anicom/site1/prodm' ELSE
- IF &INPUT EQ 15 '/rimsm/site1/prodm' ELSE
- IF &INPUT EQ 16 '/anicodm/site1/prodm' ELSE
- IF &INPUT EQ 17 '/anicoum/site1/prodm' ELSE '/anicoum/site1/prod4';


IF-THEN-ELSE, missing THEN

IF &INPUT EQ 1 THEN '/rimsi/site1/prod2' ELSE

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
quote:
-SET &INP1 = 1;
-SET &DIR = DECODE &INPUT(1 '/rimsi/site1/prod2'
- 2 '/anicoi/site1/prod4'
- 3 '/rimsi/site1/train2'
- 4 '/anicodi/site1/prod2'
- 5 '/anicoui/site1/prod3'
- 6 '/anicoui/site1/prod4'
- 7 '/rims/site1/prod1'
- 8 '/modl/site1/prod1'
- 9 '/rims/site1/train2'
- 10 '/anicodi/site1/prod1'
- 11 '/anicoui/site1/prod1'
- 12 '/anicoui/site1/prod1'
- 13 '/rimsm/site1/prodm'
- 14 '/anicom/site1/prodm'
- 15 '/rimsm/site1/prodm'
- 16 '/anicodm/site1/prodm'
- 17 '/anicoum/site1/prodm'
- 18 '/anicoum/site1/prod4');
-SET &FDEF1 = 'FILEDEF ADJMST DISK &DIR.EVAL/adjmst';
-*SET &FDEF2 = 'FILEDEF CONTRL DISK &DIR.EVAL/contrl';
-*SET &FDEF3 = 'FILEDEF SIGNRS DISK &DIR.EVAL/signrs';
-*SET &FDEF4 = 'FILEDEF SIGNGP DISK &DIR.EVAL/signgp';
-TYPE DIR => &DIR
-TYPE FDEF1 => &FDEF1
-EXIT


My Output, replacing &INPUT with &INP1:

-SET &INP1 = 1;
-SET &DIR = DECODE 1 (1 '/rimsi/site1/prod2'
- 2 '/anicoi/site1/prod4'
- 3 '/rimsi/site1/train2'
- 4 '/anicodi/site1/prod2'
- 5 '/anicoui/site1/prod3'
- 6 '/anicoui/site1/prod4'
- 7 '/rims/site1/prod1'
- 8 '/modl/site1/prod1'
- 9 '/rims/site1/train2'
- 10 '/anicodi/site1/prod1'
- 11 '/anicoui/site1/prod1'
- 12 '/anicoui/site1/prod1'
- 13 '/rimsm/site1/prodm'
- 14 '/anicom/site1/prodm'
- 15 '/rimsm/site1/prodm'
- 16 '/anicodm/site1/prodm'
- 17 '/anicoum/site1/prodm'
- 18 '/anicoum/site1/prod4');
-SET &FDEF1 = 'FILEDEF ADJMST DISK /rimsi/site1/prod2/adjmst';
-*SET &FDEF2 = 'FILEDEF CONTRL DISK &DIR.EVAL/contrl';
-*SET &FDEF3 = 'FILEDEF SIGNRS DISK &DIR.EVAL/signrs';
-*SET &FDEF4 = 'FILEDEF SIGNGP DISK &DIR.EVAL/signgp';
-TYPE DIR => /rimsi/site1/prod2
DIR => /rimsi/site1/prod2
-TYPE FDEF1 => FILEDEF ADJMST DISK /rimsi/site1/prod2/adjmst
FDEF1 => FILEDEF ADJMST DISK /rimsi/site1/prod2/adjmst
-EXIT


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
Oh just shoot me and put me out of my misery.

What a beginners error that one was. Sorry to take up valuable time on something so trivial.

Thanks


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Expert
posted Hide Post
Too Funny!!!

We ALL!!! have a brain freeze every once in awhile!!!

Winky

For your penance, you must take over Prairie's job of pointing out, to new members, how to update their profiles, for 1 week!!!

Tom

This message has been edited. Last edited by: Tom Flynn,


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
Smiler
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Virtuoso
posted Hide Post
When you've recovered sufficiently, add a final ELSE to the DECODE, perhaps

ELSE '/(no path)/');

I know, it can *never* happen ... but at least when it does you will have some gingerbread crumbs to follow.


- Jack Gross
WF through 8.1.05
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Guru
posted Hide Post
Just for you I'll add it. However, the user must click a radio button and I hard code their options.

You and my partner think alike. He likes the default also.


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Guru
posted Hide Post
quote:
p

Glenda,

After being bitten in the nether regions once to often by not coding for the default, you tend to suggest it at all times. I know, I have been there.


WF 7.6.11
Oracle
WebSphere
Windows NT-5.2 x86 32bit
 
Posts: 398 | Registered: February 04, 2008Report This Post
Guru
posted Hide Post
Any time you have user input, it is bound to happen.

That is the reason we went to Radio button input with a default set.

I don't even let the users input the date (they must pick from the calendar)!

But as you say, it is best to have coding standards in place that will prevent the unspeakable from happening.

Thanks,


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Guru
posted Hide Post
H Everybody,

Yes it is fixed with the proposal of Glenda.

Thanks a lot.


WebFocus 7.6.5
AND WebLogic server as web server
sql2005 as database server
 
Posts: 273 | Location: Europe | Registered: May 31, 2007Report This Post
Virtuoso
posted Hide Post
Majid,

Please edit the Title of your post as requested Here

Thanks


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 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] Conditional include

Copyright © 1996-2020 Information Builders