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] FOC_NONE EXAMPLE

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] FOC_NONE EXAMPLE
 Login/Join
 
Gold member
posted
Hello. Would anyone have an example of how FOC_NONE is used. I have the following and it is not working.

-*******SET clauses in the beginning of file***
-SET &DEPT = IF &DEPT EQ '' THEN 'FOC_NONE' ELSE '&DEPT';
-SET &COLL = IF &COLL EQ '' THEN 'FOC_NONE' ELSE '&COLL';
-SET &MAJOR = IF &MAJOR EQ '' THEN 'FOC_NONE' ELSE '&MAJOR';
-****end SET clauses

Then I have the following WHERE clauses:

-***WHERE clauses*******
WHERE (COLLEGE EQ '&COLL');
WHERE (DEPARTMENT_DESC EQ '&DEPT');
WHERE (MAJOR EQ '&MAJOR');
-****end WHERE clauses****

I checked the 5.3 documentation and that didn't answer my question. Thanks,

This message has been edited. Last edited by: <Kathryn Henning>,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 49 | Registered: May 11, 2011Report This Post
Gold member
posted Hide Post
You haven't to test your field against 'FOC_NONE' but you have to postfix your WHERE statement with it:

-SET &TEST = 'T';
-SET &FN_TEXT = IF (&TEST EQ 'T') THEN 'FOC_NONE' ELSE '';

TABLE FILE CAR
SUM
DEALER_COST
RETAIL_COST
BY COUNTRY
BY CAR
BY MODEL

WHERE COUNTRY EQ 'ITALY' &FN_TEXT
END
-RUN


IF &TEST is eqaual to 'T' then &FN_TEXT is set to 'FOC_NONE' and ALL countries are displayed.

Setting &TEST to anything else, &FN_TEXT is empty and only cars with COUNTRY equal to ITALY are displayed.


WebFOCUS 7.6, 7.7
Windows, All Output formats
 
Posts: 90 | Location: Stuttgart | Registered: October 20, 2010Report This Post
Virtuoso
posted Hide Post
Phoenix,

You really shouldn't need the postfix. This has always worked fine for me:
  
-SET &ECHO=ALL;
-* File phoenix02.fex
-SET &COUNTRY='FOC_NONE';
TABLE FILE CAR 
SUM
DEALER_COST
RETAIL_COST
BY COUNTRY
BY CAR
WHERE COUNTRY EQ '&COUNTRY';
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Gold member
posted Hide Post
So Danny-SRL, if I try your method and leave the parm empty, I return all. But if I put a value in the parm, I return the filtered records, correct?

P


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 49 | Registered: May 11, 2011Report This Post
Virtuoso
posted Hide Post
Phoenix,
quote:
if I try your method and leave the parm empty, I return all. But if I put a value in the parm, I return the filtered records

Right. If you want to use this method when passing parameters, then instead of
-SET &COUNTRY='FOC_NONE';
use
-DEFAULT &COUNTRY='FOC_NONE'
Then, if you do not pass a parameter, WF will use FOC_NONE, otherwise WF will use whatever you passed.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Guru
posted Hide Post
Reason Daniel suggested to use -SET instead of -DEFAULT is that, when you're passing parameters, -DEFAULT overrides its value, -SET won't.


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Silver Member
posted Hide Post
quote:
-SET &DEPT = IF &DEPT EQ '' THEN 'FOC_NONE' ELSE '&DEPT';
-SET &COLL = IF &COLL EQ '' THEN 'FOC_NONE' ELSE '&COLL';
-SET &MAJOR = IF &MAJOR EQ '' THEN 'FOC_NONE' ELSE '&MAJOR';

My approach to this would be to put the where statement itself into a variable.
-SET &QT = '''' ;
-SET &WHRDEPT = IF &DEPT EQ '' THEN 'FOC_NONE' ELSE 'WHERE DEPARTMENT_DESC EQ '|&QT||&DEPT||&QT||';';
-SET &WHRCOLL = IF &COLL EQ '' THEN 'FOC_NONE' ELSE 'WHERE COLLEGE EQ '|&QT||&COLL||&QT||';'; 
-SET &WHRMAJOR = IF &MAJOR EQ '' THEN 'FOC_NONE' ELSE 'WHERE MAJOR EQ '|&QT||&MAJOR||&QT||';';  

Then, the where clause lines are
&WHRCOLL
&WHRDEPT
&WHRMAJOR  


7.7, z/OS & Win7, excel & pdf
8.2 testing
 
Posts: 46 | Location: Tallahassee, FL ... was focused on, uh, what were we talking about? | Registered: February 03, 2012Report This Post
Gold member
posted Hide Post
Thanks for all the feedback. I'll try these out and see what works.

P


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 49 | Registered: May 11, 2011Report This Post
Virtuoso
posted Hide Post
quote:
Originally posted by Rifaz:
Reason Daniel suggested to use -SET instead of -DEFAULT is that, when you're passing parameters, -DEFAULT overrides its value, -SET won't.


What makes you think -DEFAULT overrides parameter values?

@phoenixfox:
Looking at your code, that should just "work". Apparently you expect it to do something that it doesn't, so what did you expect to happen?

Or is your question specific to WF 5.3? In that case I wouldn't know, oldest I worked with was 7.6.8.


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Guru
posted Hide Post
[QUOTE]Originally posted by Wep5622:
What makes you think -DEFAULT overrides parameter values?
QUOTE]

Hi Wep5622,

Below fex made me to thought like that.. correct me if i'm wrong..

-*proc.fex

-DEFAULT &A='Test';
-TYPE A=&A

-SET &B='Test';
-TYPE B=&B  


Now, execute the file EX proc A=SampleDEF, B=SampleSET

o/p:
SampleDEF
Test


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Guru
posted Hide Post
quote:
Originally posted by Wep5622:
What makes you think -DEFAULT overrides parameter values?


Hi Wep5622,

Below fex made me to thought like that.. correct me if i'm wrong..
-*proc.fex
-DEFAULT &A='Test';
-TYPE A=&A

-SET &B='Test';
-TYPE B=&B  

Now, execute the file EX proc A=SampleDEF, B=SampleSET
o/p:
SampleDEF
Test[/QUOTE]


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Virtuoso
posted Hide Post
That output is showing exactly the opposite of what you were claiming, doesn't it?:
-DEFAULT sets a default value that you overrode with the parameter you passed with the procedure (result is 'SampleDEF'), while -SET overrides your input parameter (result is 'Test') regardless of what you passed along for that parameter.

Perhaps you meant to claim that "-DEFAULT lets you override parameters, while -SET won't"?


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Guru
posted Hide Post
yes Wep5622 you're correct, i was wrong in my first post. Thanks!!! you're a good tester. Wink


-Rifaz

WebFOCUS 7.7.x and 8.x
 
Posts: 406 | Location: India | Registered: June 13, 2013Report This Post
Virtuoso
posted Hide Post
I know, IBI is going crazy over all the bug reports I opened :P


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 :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Gold member
posted Hide Post
I tried all the suggestions to the best of my ability and poster BGronli's worked. It's junky but it works. I'll go with it until I learn how and when to use the other methods. Thanks, P

This is done!


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 49 | Registered: May 11, 2011Report This Post
Platinum Member
posted Hide Post
If it is done, don't foget to mark it [SOLVED]. This is explained at the top of the page under Tag Your Topic with Keywords.


WebFOCUS 7.7.05 (Someday 8)
Windows 7, All Outputs
In Focus since 1983.
 
Posts: 103 | Registered: April 27, 2011Report This Post
Expert
posted Hide Post
Let's EVALuate, simplify, and remove the junky stuff from this, as follows (Try commenting out one of the -SETs):
-* File phoenix02.fex
-SET &COUNTRY='FOC_NONE';
-SET &COUNTRY='ENGLAND';
TABLE FILE CAR 
SUM
DEALER_COST
RETAIL_COST
BY COUNTRY
WHERE COUNTRY EQ '&COUNTRY.EVAL';
END




   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
  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] FOC_NONE EXAMPLE

Copyright © 1996-2020 Information Builders