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     Wildcard Characters in DECODE

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Wildcard Characters in DECODE
 Login/Join
 
Gold member
posted
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!


WF 8.1.05, Windows Server 2012 R2
 
Posts: 50 | Registered: March 26, 2004Report This Post
Virtuoso
posted Hide Post
Can you post the code and the error please.


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Expert
posted Hide Post
In my nn years of experience, I've never used a wild-card character in a DECODE.


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
Virtuoso
posted Hide Post
I've never heard of wild card characters in decode, but seeing the code would be nice. Is it on an ELSE in the decode?


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Virtuoso
posted Hide Post
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, 2005Report This Post
Virtuoso
posted Hide Post
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, 2007Report This Post
Gold member
posted Hide Post
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


WF 8.1.05, Windows Server 2012 R2
 
Posts: 50 | Registered: March 26, 2004Report This Post
Master
posted Hide Post
To my knowledge, and I have been using FOCUS and WebFOCUS for over 20 years, unless your CUSIP exactly equaled '918$$$$$$', FLAG would always be 'N'.

One correct syntax would be:
FLAG/A1=IF EDIT(CUSIP,'999') EQ '918' THEN 'Y' ELSE 'N';


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
 
Posts: 975 | Location: Oklahoma City | Registered: October 27, 2006Report This Post
Master
posted Hide Post
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, 2007Report 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     Wildcard Characters in DECODE

Copyright © 1996-2020 Information Builders