user manual
128
Chapter 8
For more information, see the topic Values a nd Data Types in Chapter 7 on p. 110. Additionally,
these rules ar
e cov ered in more detail in the following topics.
Integers
Integer s are represented as a sequence of de cimal 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 pr ecision. The maximum integer size
depends o n your platform. If the values are too large to be disp layed in an integer field, changing
the field type to Real u sually restores th e value.
Reals
Real refers to a floating-point numbe r. R eals are rep r esented by one o r more digits follo wed by a
decimal point followed by one or more digits. CLEM reals are held in do uble precis ion.
Optionally, you can place a m inus sign (−) before the real to denote a negative number––for
example, 1.234, 0.999, −77.001. U se th e form <number> e <exponent> to express a real number
in exponential notation—for example, 1234.0e5, 1.7e−2. When the IBM® SPSS® Mod eler
applicat ion reads numb er strings from files and converts them automatically to numbers, num bers
with no leading digit before the deci mal 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 CL EM expressions, a period must be used as the decimal
separat or, regardless of any settings for the current stream or locale . For example, specify
Na > 0.6
rather than
Na > 0,6
This a pplies 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 s hould be independent of any
specific locale or convention.
Characters
Charac ters (usually shown as CHAR) are typically used within a CLEM express ion 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 perform ed 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 expr ession,
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 converte d to a s tring.