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     Failure in trying to use SET to setup IS MISSING where condition.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Failure in trying to use SET to setup IS MISSING where condition.
 Login/Join
 
Member
posted
I am trying to setup the PROMPT and SET commands to determine if a record is active based on an existing or missing date field. The prompts look like this:

-PROMPT &ACTIVE.(YES,NO).

-SET &ACTIVE = IF &ACTIVE = 'YES' THEN 'IS MISSING' ELSE 'IS NOT MISSING';

The Where is:

WHERE (END_DATE '&ACTIVE')

I am trying to get the WHERE statement to be conditional based on the prompt.
 
Posts: 25 | Registered: March 15, 2006Report This Post
Virtuoso
posted Hide Post
try

IF &ACTIVE EQ .... in stead of "="

Frank




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Member
posted Hide Post
I made the correction but the results are the same. The error reads:

(FOC261) EXPRESSION IS INCOMPLETE BECAUSE AN OPERATION IS MISSING
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: ON

The line the errors point to are the WHERE statement. If I enter a normal WHERE statement the program runs fine. Is there another way to do conditional branching in the WHERE statement?
 
Posts: 25 | Registered: March 15, 2006Report This Post
Expert
posted Hide Post
What does the WHERE statement look like after variable substitution?

Have you SET &ECHO to ALL to look at the code?


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
quote:
-PROMPT &ACTIVE.(YES,NO).

-SET &ACTIVE = IF &ACTIVE = 'YES' THEN 'IS MISSING' ELSE 'IS NOT MISSING';


Guillo, your PROMPT is incorrect:

-PROMPT &ACTIVE.(<YES,1>,<NO,2>).

then:

-SET &ACTIVE = IF &ACTIVE EQ '1' THEN 'IS MISSING' ELSE 'IS NOT MISSING';

then

WHERE END_DATE '&ACTIVE';

WHERE statements should always end with a semi-colon.

You may want to use 2 & variables, ACTIVE1 for the PROMPT, &ACTIVE2, for the SET, just for clarity...

Tom

Edit: Dang Graemlins...


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
-PROMPT &ACTIVE.(YES,NO).

-SET &ACTIVE = IF &ACTIVE EQ 'YES' THEN 'IS MISSING' ELSE 'IS NOT MISSING';
.
.

WHERE (END_DATE &ACTIVE)

Just remove the single quotes from around &ACTIVE in the where, they surround the operator as well.

Prompt is fine like that, change the = as Frank said to EQ.


Alan.
WF 7.705/8.007
 
Posts: 1451 | Location: Portugal | Registered: February 07, 2007Report This Post
Member
posted Hide Post
Thanks everyone for your help. Here's the results of the last 3 approaches.

Frances:
I could not figure out how to use the SET &ECHO command. Perhaps you could provide an example.

Tom:
This approach did not work when using the single quotes on '&ACTIVE'

Alan:
by suggesting to remove the single quotes this made Tom's approach work and my original (YES,NO) method work also. This was the key to the problem. I tried different SET options and they all worked.


Thank you all for your help.
 
Posts: 25 | Registered: March 15, 2006Report This Post
Virtuoso
posted Hide Post
-SET &ECHO=ALL;




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report 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     Failure in trying to use SET to setup IS MISSING where condition.

Copyright © 1996-2020 Information Builders