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.
What this does is check for a SSN. If the SSN is either not there or labeled as 'FILE' the value 9999 is returned and displayed. However, if the SSN is there, then the last four digits of the SSN are concatenated to the the student's Campus ID. The problem that I am having is that this does not seem to work.
I get an error that says : (FOC224) SYNTAX ERROR: DECODE
This error occurs only when I'm adding the default value:
1) In the DEFINE for CardServ, you cannot use DECODE like this - you cannot concatenate the result of the DECODE to another column.
2) You DEFINE CardServ with a format of A4V but you have a different column being defined (SSN4/A4V=SUBSTR...) in the DECODE statement.
3) "If the SSN is ... not there" - does this mean it is null? You probably cannot use the DECODE value of blanl (''). The best way to deal with this is to use IF THEN ELSE.
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
You can concatenate decode as an expression, but you need to be careful about the left-hand-side format and about strong and weak concatenation. Also, remember that the code/decode pairs and the else must be *literals* and not fields (or expressions). In this case, you really should read the documentation on the DECODE operation.
Try this:
DEFINE FILE CAR
MYA/A25V = '->DECODE: ' |
DECODE COUNTRY('ENGLAND' 'WOW' 'FRANCE' 'MAN' ELSE 'OK')
|| ' COOL' ;
END
-RUN
TABLE FILE CAR
PRINT COUNTRY MYA
END
-RUN
COUNTRY MYA
------- ---
ENGLAND ->DECODE: WOW COOL
JAPAN ->DECODE: OK COOL
ITALY ->DECODE: OK COOL
W GERMANY ->DECODE: OK COOL
FRANCE ->DECODE: MAN COOL