Focal Point
Use of "Is Like" in Defined Field?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/7231068092

July 08, 2008, 11:44 AM
plusrelo
Use of "Is Like" in Defined Field?
Is it possible to use the logical relation "is like" in a define statement? For example, "IF ACCOUNT IS LIKE '3$$-$$' THEN...." I can't seem to get it to work, but maybe my syntax is not correct. I've tried it with and without the word "like".


WebFOCUS 7.6.8
MS Windows XP
July 08, 2008, 11:58 AM
Tom Flynn
IF EDIT(ACCOUNT,'9') EQ '3' THEN


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
July 08, 2008, 11:58 AM
Francis Mariani
Be careful which MASK characters you use.

DEFINE FILE CAR
TEST1/A3 = IF COUNTRY LIKE '__A%' THEN 'YES' ELSE 'NO';
END
TABLE FILE CAR
PRINT
COUNTRY
TEST1
END


quote:
mask

Is an alphanumeric or text character string you supply. There are two wildcard characters that you can use in the mask: the underscore (_) indicates that any character in that position is acceptable; the percent sign (%) allows any following sequence of zero or more characters.


quote:
Reference: Restrictions on Masking Characters
The wildcard characters dollar sign ($) and dollar sign with an asterisk ($*), which are used with IS operators, are treated as literals with LIKE operators.

Masking with the characters $ and $* is not supported for compound WHERE phrases that use the AND or OR logical operators.



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
July 08, 2008, 12:45 PM
plusrelo
Thanks!


WebFOCUS 7.6.8
MS Windows XP