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.
To my understanding the reason you are getting incorrect results is because of when the amper variable is being evaluated. By using &VAL1 and '&VAL1.EVAL' they will be replaced with there value before the code runs. '&VAL1' will be replaced with its value after the code runs, this is why it looks right. Since '&VAL1' and '&VAL1.EVAL' are strings not variables by using .EVAL in the string it will cause the variable to replaced with its value before the if statement is processed.
-SET &ECHO=ALL; -SET &VAL1 = '.'; -SET &TEST1 = IF ('Hi &VAL1' EQ 'Hi .') THEN 'XXX' ELSE 'YYY'; -SET &TEST2 = IF ('Hi &VAL1.EVAL' EQ 'Hi .') THEN 'XXX' ELSE 'YYY'; -TYPE TEST1: &TEST1 -TYPE TEST2: &TEST2
Also if you have a variable that could be '' you may want to use the function ASIS() since '' and 0 will evaluate to the same thing.
-SET &ECHO=ALL; -SET &VAL1 = ''; -SET &VAL2 = 0; -SET &TEST1 = IF (ASIS('&VAL1.EVAL') NE 0) THEN 'XXX' ELSE 'YYY'; -SET &TEST2 = IF (ASIS('&VAL2.EVAL') NE 0) THEN 'XXX' ELSE 'YYY'; -SET &TEST3 = IF ('&VAL1.EVAL' NE 0) THEN 'XXX' ELSE 'YYY'; -SET &TEST4 = IF ('&VAL2.EVAL' NE 0) THEN 'XXX' ELSE 'YYY'; -TYPE TEST1: &TEST1 -TYPE TEST2: &TEST2 -TYPE TEST3: &TEST3 -TYPE TEST4: &TEST4
Posts: 406 | Location: Canada | Registered: May 31, 2004
Curtis, thanks for your explanation. I was aware of the difference between '&AVR.EVAL, '&VAR' and '&VAR', but this does not explain why, when the amper value being tested is a . (dot), the DM code does not work.
hmmm what an intersting prob. The dot operator is a comment signal to scripting languages, so i'm guessing that DM somehow is tripping over that. The empty is more puzzling: given &VAL1=''; then &VAL1.EXIST equals 1 and &VAL1.LENGTH also equals 1 both of which are counter-intuitive results ,to me. I'm expecting 0 at least for the second test. Meaning &VAL1=''; is the same as &VAL1=' ';, hmmm. How about seeing if the hex translation is a hex40, a real blank. Your work around certainly seems totally reasonable.
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003