July 08, 2008, 11:44 AM
plusreloUse 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".
July 08, 2008, 11:58 AM
Tom FlynnIF EDIT(ACCOUNT,'9') EQ '3' THEN
July 08, 2008, 11:58 AM
Francis MarianiBe 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