IBM 15 Manuale Utente

Pagina di 270
128
Chapter 8
For more information, see the topic
in Chapter 7 on p. 110. Additionally,
these rules are covered in more detail in the following topics.
Integers
Integers are represented as a sequence of decimal digits. Optionally, you 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 integer field, changing
the field type to Real usually restores the value.
Reals
Real refers to a floating-point number. Reals are represented by one or more digits followed by a
decimal point followed by one or more digits. CLEM reals 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 <exponent> 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 properties dialog
box and is consistent with the general guideline that code syntax should be independent of any
specific locale or convention.
Characters
Characters (usually shown as
CHAR) are typically used within a CLEM expression to 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 expression uses a character to indicate
that the test should be performed on the first character of the string:
isuppercode(subscrs(1, "MyString"))
To express the code (in contrast 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 or filled with an expression
that results in a
CHAR, then that result will be converted to a string.