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] -INCLUDE within IF/THEN/ELSE

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] -INCLUDE within IF/THEN/ELSE
 Login/Join
 
Gold member
posted
After searching, I still have a question.
IS it possible to do something like the following:
IF '&SPECIALTY' EQ 'ART THEN
-INCLUDE Ed_ART_PreK_thru_12_Rev_Sep_2010.fex
ELSE IF '&SPECIALTY' EQ 'BIO' THEN
-INCLUDE Ed_BIO_6_thru_12_Rev_Sep_2010.fex
ELSE
-INCLUDE Dummy.fex
END

The includes contain Defines of the same fields but have different values depending on the value of &SPECIALTY. The defines are rather large and I would really like to include just the one needed. The rest of the fex is the same for all reports (not dependant on &SPECIALTY)

Thank you in advance. The forum has been a wealth of tips and techniques.
Paul

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


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
 
Posts: 75 | Location: Wichita, KS | Registered: February 19, 2008Report This Post
Platinum Member
posted Hide Post
I don't think that's possible.
But you can try this way

-IF '&SPECIALTY' EQ 'ART' THEN GOTO :ART;
-IF '&SPECIALTY' EQ 'BIO' THEN GOTO :BIO;
-INCLUDE Dummy.fex
-GOTO :END_RPT
-:ART
-INCLUDE Ed_ART_PreK_thru_12_Rev_Sep_2010.fex
-GOTO :END_RPT
-:BIO
-INCLUDE Ed_BIO_6_thru_12_Rev_Sep_2010.fex
END
-:END_RPT


WF 7.7.02 on Windows 7
Teradata
HTML,PDF,EXCEL,AHTML
 
Posts: 165 | Registered: September 29, 2008Report This Post
Platinum Member
posted Hide Post
Atturhari is correct. You can't use -INCLUDE as part of the IF statement. Also, Dialogue Manager statements need DASHES at the start of each line. And you don't need an END statment. It looks like you've not had too much experience with Dialogue Manager. Read up on it. DM is your friend.

Atturhari's code will work, though the END is not needed and each -INCLUDE will need to have -MRNOEDIT in front if run from MRE.

Another more streamlined method uses DECODE. It's easier to insert a define fex by just adding a new decode pair line. Note, you will need the -MRNOEDIT for the -INCLUDE if running from MRE.

-SET &RUNIT=DECODE &DEFINECALL(ART Ed_ART_PreK_thru_12_Rev_Sep_2010.fex
-                              BIO Ed_BIO_6_thru_12_Rev_Sep_2010.fex
-                              ELSE Dummy.fex);
-MRNOEDIT -INCLUDE &RUNIT.EVAL



In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
 
Posts: 161 | Location: Dallas, TX | Registered: February 20, 2009Report This Post
Gold member
posted Hide Post
Thank you all for your replies. I tried both and and could not fet either to work (yet).
-SET &RUNIT=DECODE &SPECIALTY(ART 'fcqy7de6.fex'
BIO 'Ed_BIO_6_thru_12_Rev_Sep2010.fex'
EED 'Ed_EED_K_thru_6_Rev_Sep2010.fex'
ELSE '');
-MRNOEDIT -INCLUDE app/&RUNIT.EVAL

gives (FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND: app/&RUNIT.EVAL.

If I take out the 'app/' I get a (FOC2905) &VARIABLE IS NOT ALLOWED AS A FILENAME IN THIS CONTEXT: &RUNIT.EVAL. The suggestion from a 2008 post was to add app/.

The members to include are in the 'Other' folder in DevStudio. Does this make a differance? I am using the actual file name in the decode.

Obviously I am missing something very small. Please advise.
Thanks.
Paul

PS: I like the Dm method but feel I have more to learn before playing with it.


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
 
Posts: 75 | Location: Wichita, KS | Registered: February 19, 2008Report This Post
Virtuoso
posted Hide Post
This is probably caused becuase of the parameter prompting that is enabled on your system. Don't know if this workaround will work, but give it a try:
-SET &RUNIT=DECODE &SPECIALTY(ART '-INCLUDE fcqy7de6.fex'
BIO '-INCLUDE Ed_BIO_6_thru_12_Rev_Sep2010.fex'
EED '-INCLUDE Ed_EED_K_thru_6_Rev_Sep2010.fex'
ELSE '');
-MRNOEDIT &RUNIT.EVAL


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Platinum Member
posted Hide Post
Each Dialogue Manager statement requires a dash be placed in the first postion on every line and if it's a continuation line a space after the dash:
-SET &RUNIT=DECODE &SPECIALTY(ART '-INCLUDE fcqy7de6.fex'
- BIO '-INCLUDE Ed_BIO_6_thru_12_Rev_Sep2010.fex'
- EED '-INCLUDE Ed_EED_K_thru_6_Rev_Sep2010.fex'
- ELSE '');
-MRNOEDIT &RUNIT.EVAL



In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
 
Posts: 161 | Location: Dallas, TX | Registered: February 20, 2009Report This Post
Gold member
posted Hide Post
Well, I got the decode to work. Now it can not find the include.

END
-SET &RUNIT=DECODE BIO(ART '-INCLUDE fcqy7de6.fex'
- BIO '-INCLUDE Ed_BIO_6_thru_12_Rev_Sep2010.fex'
- EED '-INCLUDE Ed_EED_K_thru_6_Rev_Sep2010.fex'
- ELSE '');
-INCLUDE Ed_BIO_6_thru_12_Rev_Sep2010.fex
(FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND:
Ed_BIO_6_thru_12_Rev_Sep2010.fex
TABLE FILE HOLDDATA

(BIO after decode is the value of the parameter &SPECIALTY)
When in DevStudio, I have the includes in the 'Other' folder. Does that make a differance? I have tried putting 'app/' in front of the include name (-INCLUDE app/....).
Is there a path setting somewhere that I have missed? If I just include 1 item (without the decode and eval) it works fine.

Sorry to be a bother, but I have 13 of these includes and all of them are rather large.

Thanks again
Paul


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
 
Posts: 75 | Location: Wichita, KS | Registered: February 19, 2008Report This Post
Platinum Member
posted Hide Post
After actually creating some test fexes and storing in the same domain as the main fex and getting the same error as you, I did some research and found this will not work, at least not easily. See post http://forums.informationbuild...71057331/m/350103914 for more info.

From an IBI tech post from 2004:
"... Unfortunately, you can't do it. The issue is, the MRE Dialogue Manager processing is NOT the FULL D.M., but only provides variable substitution. It doesn't really support the '.EVAL' qualifier, which would cause a second 'interpretation' of the line. As a result, the -INCLUDE doesn't see the value as a filename, and can't locate it. That's why you get that error."

Follow the links and see some suggestions.

My suggestions:

1) Follow Francis Mariani's from the post link given above and hard code the fex names and use GOTO

or

2) Store the program fexes in a folder on the data server and call them from the MRE domain folder. Let's say the report fexes are stored in "baseapp". The main fex in the MRE domain folder should look like this:

-SET &DEFINECALL='ART';
-SET &RUNIT=DECODE &DEFINECALL(ART Ed_ART_PreK_thru_12_Rev_Sep_2010.fex
-                              BIO Ed_BIO_6_thru_12_Rev_Sep_2010.fex
-                              ELSE Dummy.fex);
-MRNOEDIT -INCLUDE baseapp/&RUNIT.EVAL



In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
 
Posts: 161 | Location: Dallas, TX | Registered: February 20, 2009Report This Post
Expert
posted Hide Post
To avoid any problems, MRE or not, I now never use Dialogue Manager variables in a -INCLUDE.


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
Expert
posted Hide Post
WE have used & variables in -INCLUDES, but mostly use an & var to comment a -INCLUDE.

-SET &Comment = IF condition THEN '-*' ELSE '' ;
.
.
.
&Comment.EVAL-INCLUDE ...


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
Guru
posted Hide Post
 -SET &ECHO='ALL';

-DEFAULT &SPECIALTY = 'ART';

-IF '&SPECIALTY' EQ 'ART' THEN GOTO :LBLART ELSE GOTO :LBLBIO
-:LBLART
-INCLUDE Ed_ART_PreK_thru_12_Rev_Sep_2010.fex
-GOTO :ENDRPT

-:LBLBIO
-IF '&SPECIALTY' EQ 'BIO' THEN GOTO :LBLINBIO ELSE GOTO :LBLDUMMY
-:LBLINBIO
-INCLUDE Ed_BIO_6_thru_12_Rev_Sep_2010.fex
-GOTO :ENDRPT

-:LBLDUMMY
-INCLUDE Dummy.fex

-:ENDRPT
-EXIT 


This is something you might be looking for.


Thanks,

Ramkumar.
WebFOCUS/Tableau
Webfocus 8 / 7.7.02
Unix, Windows
HTML/PDF/EXCEL/AHTML/XML/HTML5
 
Posts: 394 | Location: Chennai | Registered: December 02, 2009Report This Post
Gold member
posted Hide Post
Sorry for being slow in replying. We have been closed for a couple of days due to snow and bitter cold. Let me look at the suggestions and I will let the forum know what I find.
Thank you all VERY much for your suggestions. This is what makes the forum valuable.


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
 
Posts: 75 | Location: Wichita, KS | Registered: February 19, 2008Report This Post
Expert
posted Hide Post
How about some self modifying code, as follows:
-* use one of the following two lines for testing:
-SET &SPECIALTY = 'ART' ;
-SET &SPECIALTY = 'BIO' ;

-SET &USE_ART = IF &SPECIALTY EQ 'ART' THEN '' ELSE '-* DO NOT USE ART' ;
-SET &USE_BIO = IF &SPECIALTY EQ 'BIO' THEN '' ELSE '-* DO NOT USE BIO' ;

&USE_ART.EVAL-TYPE -INCLUDE Ed_ART_PreK_thru_12_Rev_Sep_2010.fex
&USE_BIO.EVAL-TYPE -INCLUDE Ed_BIO_6_thru_12_Rev_Sep_2010.fex
Remove the "-TYPE " for reality. Try it, you just might like it...




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Platinum Member
posted Hide Post
Doug, compact, easy to read and understand, nice! Love not using GOTO and a Label, too.



In FOCUS since 1985 - WF 8.009/8.104 Win 8 Outputs: ALL of 'em! Adapters: Sql Server Teradata Oracle
 
Posts: 161 | Location: Dallas, TX | Registered: February 20, 2009Report This Post
Expert
posted Hide Post
Thanks... Simplicity is Great.

"No one can do everything. But, if everyone does something then everything gets done." ~ Millicent
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Gold member
posted Hide Post
OK. Here is what I have. The following works like a champ:
-IF &SPECIALTY EQ 'ART' THEN GOTO LBLART ELSE GOTO LBLBIO;
-LBLART
-INCLUDE app/fcqy7de6.fex
-GOTO CONT_RPT;
-LBLBIO
-IF &SPECIALTY EQ 'BIO' THEN GOTO LBLINBIO ELSE GOTO LBLEED;
-LBLINBIO
-INCLUDE app/r4yv1qfx.fex
-GOTO CONT_RPT;
-LBLEED
-IF &SPECIALTY EQ 'EED' THEN GOTO LBLINEED ELSE GOTO CONT_RPT;
-LBLINEED
-INCLUDE app/dfcoz1x9.fex
-CONT_RPT

Doug's idea is great except there appears to be a problem with eval and includes:

-SET &USE_ART = IF BIO EQ 'ART' THEN '' ELSE '-* Do not use art';
-SET &USE_BIO = IF BIO EQ 'BIO' THEN '' ELSE '-* Do not use bio';
-* Do not use art-INCLUDE app/fcqy7de6.fex
-INCLUDE app/r4yv1qfx.fex
(FOC227) THE FOCEXEC PROCEDURE CANNOT BE FOUND: app/r4yv1qfx.fex

I had the same trouble using DECODE and EVAL. I am just a novice so I will leave this to better minds than mine. Thanks to everyone for their input and assistance.
Paul


Prod: WF 7.7.05, BID, MRE, 7.7.06M Server, Windows 2008, RedHat, Oracle 11gR1, MS Office 2010
Test: I wish we had one!
 
Posts: 75 | Location: Wichita, KS | Registered: February 19, 2008Report This Post
Expert
posted Hide Post
First: Try it without the ".EVAL".

OR: If you really want / need to use labels, try something like this (I'm keyboard composing so I hope this works. No need for that peksy -IF stuff...
-GOTO LBL&SPECIALTY.EVAL
-LBLART
-INCLUDE app/fcqy7de6.fex
-GOTO CONT_RPT;
-LBLBIO
-IF &SPECIALTY EQ 'BIO' THEN GOTO LBLINBIO ELSE GOTO LBLEED;
-LBLINBIO
-INCLUDE app/r4yv1qfx.fex
-GOTO CONT_RPT;
... etc ...
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
quote:
-SET &SPECIALTY = 'ART' ;
-SET &SPECIALTY = 'BIO' ;

-SET &USE_ART = IF &SPECIALTY EQ 'ART' THEN '' ELSE '-* DO NOT USE ART' ;
-SET &USE_BIO = IF &SPECIALTY EQ 'BIO' THEN '' ELSE '-* DO NOT USE BIO' ;

&USE_ART.EVAL-TYPE -INCLUDE Ed_ART_PreK_thru_12_Rev_Sep_2010.fex
&USE_BIO.EVAL-TYPE -INCLUDE Ed_BIO_6_thru_12_Rev_Sep_2010.fex




   In FOCUS Since 1983 ~ from FOCUS to WebFOCUS.
   Current: WebFOCUS Administrator at FIS Worldpay | 8204, 8206
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 2005Report This Post
Expert
posted Hide Post
OK, I had to get in to Dev Studio...

Here's the working solution, program and results:
ART Program (INCLUDE_ART_CODE.fex), used as a -INCLUDE in LABEL_BRANCHING.fex:
-* File INCLUDE_ART_CODE.fex
-TYPE *** This is being executed in INCLUDE_ART_CODE.fex at &DATEMtDYY @ &TOD ***


BIO Program (INCLUDE_BIO_CODE.fex), used as a -INCLUDE in LABEL_BRANCHING.fex:
-* File INCLUDE_BIO_CODE.fex
-TYPE *** This is being executed in INCLUDE_BIO_CODE.fex at &DATEMtDYY @ &TOD ***


Test Program (LABEL_BRANCHING.fex):
[code]-* File LABEL_BRANCHING.fex
-SET &SPECIALTY = 'ART' ;

-SET &USE_ART = IF &SPECIALTY EQ 'ART' THEN '' ELSE '-* DO NOT USE ART' ;
-SET &USE_BIO = IF &SPECIALTY EQ 'BIO' THEN '' ELSE '-* DO NOT USE BIO' ;

&USE_ART.EVAL-INCLUDE INCLUDE_ART_CODE.fex
&USE_BIO.EVAL-INCLUDE INCLUDE_BIO_CODE.fex

-TYPE *** LABEL_BRANCHING : TEST COMPLETE

Results:
 *** This is being executed in INCLUDE_ART_CODE.fex at Feb  4, 2011 @ 21.39.36 ***
 *** LABEL_BRANCHING : TEST COMPLETE


Test Program (LABEL_BRANCHING.fex):
-* File LABEL_BRANCHING.fex
-SET &SPECIALTY = 'BIO' ;

-SET &USE_ART = IF &SPECIALTY EQ 'ART' THEN '' ELSE '-* DO NOT USE ART' ;
-SET &USE_BIO = IF &SPECIALTY EQ 'BIO' THEN '' ELSE '-* DO NOT USE BIO' ;

&USE_ART.EVAL-INCLUDE INCLUDE_ART_CODE.fex
&USE_BIO.EVAL-INCLUDE INCLUDE_BIO_CODE.fex

-TYPE *** LABEL_BRANCHING : TEST COMPLETE

Results:
 *** This is being executed in INCLUDE_BIO_CODE.fex at Feb  4, 2011 @ 21.39.36 ***
 *** LABEL_BRANCHING : TEST COMPLETE


Doug

This message has been edited. Last edited by: Doug,
 
Posts: 3132 | Location: Tennessee, Nashville area | Registered: February 23, 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] -INCLUDE within IF/THEN/ELSE

Copyright © 1996-2020 Information Builders