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.
I found a very strange behavior in the Dialog Manager. I’m trying to test whether the content of a variable is empty or not. The variable is supplied from a launch page. For this I’m using the following statement:
-IF &VAR1.EXISTS THEN GOTO STEP01 ELSE GOTO DONE -STEP01 -IF ‘&VAR1.EVAL’ NE ‘’ THEN GOTO STEP02 ELSE GOTO DONE -STEP02 WHERE TEST EQ VAR1; -DONE So if the variable &VAR1 contains ‘000000’ as the content, I would assume that the result would be: -IF 1 THEN GOTO STEP01 ELSE GOTO DONE -STEP01 -IF ‘00000’ NE ’ THEN GOTO STEP02 ELSE GOTO DONE -STEP02 WHERE TEST EQ VAR1; -DONE
Instead the result is: -IF 1 THEN GOTO STEP01 ELSE GOTO DONE -STEP01 -IF ‘00000’ NE ‘ THEN GOTO STEP01 ELSE GOTO DONE -DONE
How can this happen? Does anybody have a solution for my problem?
thanks for your comment. The actual if statements are terminated with a semincolon. I tried your code and the result was the same. It looks likes this: -IF NOT(1) THEN GOTO DONE; -STEP01 -IF '000000' EQ '' THEN GOTO DONE; -DONE
How comes that for the comparation both values are equal?
Olaf
quote:
Originally posted by Tony A: Olaf,
You need to teminate your DM IF statement with a semi-colon and I would remove the EVAL -
-IF &VAR1.EXISTS THEN GOTO STEP01 ELSE GOTO DONE;
-STEP01
-IF '&VAR1' NE '' THEN GOTO STEP02 ELSE GOTO DONE;
-STEP02
WHERE TEST EQ VAR1;
-DONE
However, I would prefer to use -
-IF NOT(&VAR1.EXISTS) THEN GOTO DONE;
-STEP01
-IF '&VAR1' EQ '' THEN GOTO DONE;
-STEP02
WHERE TEST EQ VAR1;
-DONE
-SET &ECHO = ALL ;
TABLE FILE CAR
PRINT CAR COUNTRY SEATS
-IF NOT(&VAR1.EXISTS) THEN GOTO DONE;
-STEP01
-IF &VAR1 EQ ' ' THEN GOTO DONE;
-STEP02
WHERE SEATS GT &VAR1
-DONE
END
-RUN
in your screening condition, you need to make VAR1 the ampver var &VAR1 and.. if it is a literal, not a value, you'll need to enclose it in quotes, otherwise IF COUNTRY EQ FRANCE will bomb, it'll look for a field named FRANCE. and ... sometimes i have found that EQ '' must be replaced with EQ ' ' (put a space in) the .LENGTH operator on an &var shows a minimum of 1, and never 0. go figure. something about just addressing it makes it exist...dunno...i think someone else explained it to me once.This message has been edited. Last edited by: susannah,
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
I'm assuming you want '000000' to not be treated as '' here is a way. Also CHECK out the usage of setting a variable to a value of FOC_NONE
-DEFAULT &VAR1 = '';
-IF 'X&VAR1.EVAL' NE 'X' THEN GOTO :SKIPSET;
-SET &VAR1 = 'FOC_NONE';
-:SKIPSET
TABLE FILE CAR
PRINT CAR COUNTRY SEATS
WHERE COUNTRY EQ '&VAR1';
END
In the above code if I default the variable var1 to blank I get all rows. If I default it to 'ENGLAND' I only get ENGLAND. If I default it to '000000' I get no data.
FOC_NONE tell the WebFOCUS parser the throw away the statement.
Originally posted by susannah: if it is a literal, not a value, you'll need to enclose it in quotes, otherwise IF COUNTRY EQ FRANCE will bomb, it'll look for a field named FRANCE.
The right-hand side of the condition in IF is always taken to be a literal value.
But the quotes are harmless, and will save you if the supplied value has an imbedded space.
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
It seams that there is a problem in Solaris with the comparison of zeros with an empty string or a string with a blank. This might only happen with Solaris. I hope in newer version this bug will be fixed.