
128
Chapter 8
For more information, see the topic Values and Data Types in Chapter 7 on p. 110. Additiona lly,
these rules are covered in more detail in the following topics.
IntegersIntegers are represented as a sequence of decimal digits. Optionally,yo u can place a minus sign
(−) before the integer to denote a negative number—for example, 1234,999, −77.
The CLEM language handles integers of arbitrary precision. The maximum integer size
depends on your platform. If the values are too large to be displayed in an int eger field, changing
the field type to Real usually restores the value.
RealsReal refers to a floating-point number. Reals are represented by one or m ore digits followed by a
decimal point followed by one or more digits. CLEM r eals are held in double precision.
Optionally, you can place a minus sign (−) before the real to denote a negative number––for
example, 1.234,0.999, −77.001. Use the form <number> e <e xponent> to express a real number
in exponential notation—for example, 1234.0e5,1.7e−2. When the IBM® SPSS® Modeler
application reads number strings from files and converts them automatically to numbers, numbers
with no leading digit before the decimal point or with no digit after the point are accepted––for
example, 999. or .11. However, these forms are illegal in CLEM expressions.
Note: When referencing real numbers in CLEM expressions, a period must be used as the decimal
separator, regardless of any settings for the current stream or locale. For example, specify
Na> 0.6
rather than
Na> 0,6
This applies even if a comma is selected as the decimal symbol in the stream prop erties dialog
box and is consistent with the general guideline that code syntax should be independent of any
specific locale or convention.
CharactersCharacters (usually shown as CHAR) are typically used within a CLEM expression t o perform
tests on strings. For example, you can use the function isuppercode to determine whether the first
character of a string is upper case. The following CLEM exp ression uses a character to indicate
that the test should be performed on the first character of the string:
isuppercode(subscrs(1,"MyString"))
Toexpress the code (incontr ast to the location) of a particular character in a CLEM expression,
use single backquotes of the form `<character>`––for example, `A`,`Z`.
Note: There is no CHAR storage type for a field, so if a field is derived o rfil led with an expression
that results in a CHAR, then that result will be converted to a string.