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.
Are there any wildcard characters allowed in a DECODE in WebFOCUS? I've seen dollar signs used as wildcard characters in WHERE clauses, but someone I work with discovered some old code that is using a dollar sign in a DECODE. We just upgraded to 7.6 and when we also discover problems like this, it's easy to conclude that it is a problem with the new version of WebFOCUS. I argue that this never worked because I don't think DECODEs can use wildcards. Can someone definitively tell me whether DECODEs can contain wildcard characters? Thanks for your time!
We have found when upgrading...strange things that should not have worked - did in older version...and then suddenly they did not because of "tightening the code".
In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005
Using DECODE will only allow you to compare literal values and it will only return a literal value. There is no support for wildcards within a decode. All characters are treated as they are specified. The only operator used internally with DECODE is the EQ operator. If the value offered is not in the decode list, you'll get the values specified by the ELSE clause in the DECODE. That's all folks.
GamP
- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007
Thanks GamP for explaining what is happening internally. For those who wanted a code example, I'll give you a generic sample, however I was more interested in simply knowing whether or not DECODE allowed wildcard characters.
For example, wanting to flag all rows containing a CUSIP beginning with '918'...
DEFINE FILE THIS FLAG/A1=DECODE CUSIP ( '918$$$$$$' 'Y' ELSE 'N'); END
If you are using FLAG in a where statement eliminate this are replace it with WHERE EDIT(CUSIP,'999') EQ (OR NE) '918' rather than WHERE FLAG EQ 'Y' (OR 'N')
Pat WF 7.6.8, AIX, AS400, NT AS400 FOCUS, AIX FOCUS, Oracle, DB2, JDE, Lotus Notes
Posts: 755 | Location: TX | Registered: September 25, 2007